--- Coro/Changes 2007/04/14 15:08:15 1.221 +++ Coro/Changes 2008/12/15 16:22:34 1.482 @@ -1,10 +1,507 @@ Revision history for Perl extension Coro. -TODO: better (earlier) error messages on broken transfer's -TODO: destroy gets only called on cancel: fix(?) -TODO: should explore PerlIO::via::CoroCede and PerlIO::via::CoroAIO. +TODO: should explore PerlIO::coroaio (perl leaks like hell). +TODO: maybe implement a default message channel, very much like Erlang's + actor model (which is cool in a lot of important aspects (failures!), + but very lacking in others (higher level ipc)). -TODO: eg/event +5.13 + - EXPERIMENTAL: implement dynamic winds (on_enter/on_leave). + - don't set diehook to C but instead to NULL, to avoid + spurious warnings. + - fix a lot of bugs in Coro::SemaphoreSet. + - Coro::SemaphoreSet will less often create a semaphore needlessly. + - add Coro::SemaphoreSet::count and wait methods. + - take advantage of the new Guard module. + - deprecate Coro::guard. + - try to fix the dreaded 01_unblock tests once more. I hate it when + testsuites need more fixing than the code they are supposed to test. + - croak in more cases when a required callback isn't resolvable. + - fix some minor issues in Coro::State->call/eval. + - use current coroutine context instead of a temporary one + when temporarily switching to another coroutine. + +5.12 Sun Dec 7 13:30:38 CET 2008 + - add default config for MirOS, which seems to be a bug-to-bug + compatible fork of openbsd ("world domination by releasing + openbsd cvs before the openbsd folks do it" or so :). + - free_padlist did destroy the names pad, not good, but didn't + seem to bother perl - this could fix issues such as eval "" + inside a function called from multiple coroutines. + - use a different method to detect destruction time. + - be more careful when freeing padlists just before global + destruction. + - fixed and expanded the call/cc example. + - renamed _terminate to _coro_run. + - new method Coro::Channel->shutdown. + - try pthreads on openbsd <4.4 (broken sigaltstack, will + pthreads fare better?). + - be less picky about destroying "a" running coroutine. + +5.11 Tue Nov 25 21:49:05 CET 2008 + - DEBUGGING in 5.10.0 is a mess: it constantly flags perfectly + working code with failed assertions, introducing more bugs than + it fixes, requiring elaborate workarounds :( + +5.1 Mon Nov 24 08:54:59 CET 2008 + - wrote a small introductory tutorial - Coro::Intro. + - convert Coro::Timer, Coro::Select and Coro::Util to rouse API. + - Coro::Select did errornously dup the file descriptors + and didn't work with all AnyEvent backends. + - Coro::Select wasn't imported correctly form Coro::LWP, causing blocking + LWP data transfers. + - disassociate c contexts from coro objects - this is agruably more + correct, but mostly allows sharing of cctxs between coro and state + objects, for added memory savings and speed increases. + - bumped $Coro::POOL_RSS up to 32kb by default. + - no longer set the optype to OP_CUSTOM, as B::* understandably + doesn't like this very much (and we *are* a type of entersub). + - implement state cloning, just to prove that call/cc can be done. + - automatically load Coro::AnyEvent in Coro::Handle. + - wrap ->cancel calls in eval inside Coro::Handle as EV watchers + do not have this method (and don't need it either). + - speed up generic anyevent methods in Coro::Handle by using rouse + callbacks. + - allow coroutines in $Coro::IDLE, speeding up Coro::AnyEvent and + others. It also makes the debugger happier, as you can trace + through the idle threads now. + - add comppad_name* and hints ($^H, %^H) to per-thread variables. + - eg/event was pretty broken. + - better 5.8.6 compatibility. + +5.0 Thu Nov 20 10:35:05 CET 2008 + - NEW ARCHITECTURE: use the latest 4.x version if you experience + stability issues. + - bump API version to 7 - all dependents must be recompiled. + - removed timed_* functions - they were not being used anyways + and should be replaced by a more generic mechanism - + and were annoying to support anyways :) + - removed SemaphoreSet's waiter method - use sem method instead. + - Coro::Semaphore->adjust didn't correctly wake up enough waiters. + - async_pool did free a scalar value twice + ("Attempt to unreference..."). + - fix a longstanding bug where calling terminate on a coro that + was waiting for a semaphore that was just becoming available + would cause a deadlock (semaphore would get into a state where + it was available but waiters were still blocked). + - calling throw on a coroutine that is waiting for a semaphore will + no longer make it acquire the semaphore (and thus leak a count). + - perl's process emulation is now not even theoretically supported + anymore. + - new functions Coro::rouse_cb and Coro::rouse_wait for easier + conversion of callback-style to blocking-style. + - new methods $coro->schedule_to and ->cede_to, to specifically + schedule or cede to a specific coroutine. + - new function Coro::Semaphore::wait. + - use named constants in Coro::Channel (Richard Hundt). + - directly patch the entersub opcode calling SLF functions (cede, + transfer and so on). this does speed up context switching, but + more importanly, it frees us from the hardcoded behaviour of + entersub, so we might actually be able to return something from + those functions and atcually create new ones. + - take advantage of __builtin_frame_address on gcc. + - expose THX in coroapi (not sure whether this was a wise decision, + as "threaded" perls are running at half speed anyways). + - implement execute_slf (schedule-like-function) interface that makes + it possible to implement schedule-like-functions in XS. + - use new SLF interface to massively speed up Coro::EV by roughly a + factor of two. + - used new SLF interface to massively speed up Coro::Semaphore by a + factor of three. + - used new SLF interface to speed up Coro::AIO by roughly a factor of + four and reduce its memory usage considerably. + - implement Coro::SemaphoreSet purely in terms of Coro::Semaphore, + for a nice speedup and vastly more correct behaviour. Also implement + a new method "sem" to get at the underlying semaphore object. + - implement Coro::Channel in terms of Coro::Semaphore, for a moderate + (in comparison) 20-40% speedup. + - used new SLF interface to reimplement Coro::Signal gaining + some unknown (because I was too lazy), but certain, speedup, and also + making signals reliable for the first time. + - used new SLF interface and other optimisations to speed up async_pool + by a factor of two. It also doesn't rely on perl's exception mechanism + to exit anymore. The overhead for terminating an async_pool, coro over + a normal async is now very small. + - sped up coroutine creation/destruction by 40%. + - forgot to include Coro/libcoro/README in the dist for all these years. + - work around a freebsd pthreads bug (manual testcancel is required as + pthread_cond_wait isn't a cancellation point on freebsd). + - use new rouse functions to speed up and simplify Coro::BDB. + - make "prefer perl native functions" work with threaded perls. + - condense Coro::Debug ps output, hint at v and w flags. + - (libcoro) lots of minor cleanups and portability improvements. + +4.914 Wed Nov 19 12:54:18 CET 2008 + - fix a disastrous bug in the readline optimisation + introduced in 4.801. + +4.913 Sat Nov 15 07:58:28 CET 2008 + - async_pool did free a scalar value twice + ("Attempt to unreference..."). + +4.912 Thu Nov 13 18:31:23 CET 2008 + - minor cleanups. + - use much larger stacks on linux and perl < 5.8.8. + - Coro::Debug::new_unix_server did not unlink the socket + when destroyed. + +4.911 Tue Nov 11 04:26:17 CET 2008 + - "port" to threaded perls. + +4.91 Mon Nov 10 05:36:38 CET 2008 + - the ->throw exception object no longer leaks. + - creating a new cctx leaked a scopestack entry (memleak). + - new coroutines didn't get created with a zero flags field + (unknown impact). + - calling ->throw on a not-yet-started coroutine should now work + instead of being ignored. + - ->throw is now supported on Coro::State objects. + - clean up cctx creation code a bit. + - entersub is actually a UNOP, not a LOGOP (not a bugfix). + +4.9 Sat Nov 8 17:45:27 CET 2008 + - (libcoro) did not preserve rbp with CORO_ASM (we are getting there). + - (libcoro) no longer leak threads in the experimental pthread backend, + also speed it up considerably. + - (libcoro) do not rely on makecontext passing void *'s unscathed. + - fix compiletime dependencies on libcoro in the Makefile. + - cctx_count wasn't always updated properly. + - Coro::State::cctx_stacksize wasn't applied correctly. + - new function Coro::State::cctx_max_idle. + - the default max number of idle C contexts is now 4. + - (libcoro) try harder to get _setjmp/_longjmp. + - (libcoro) cleanup and extend the libcoro API to officially + allow the creation of empty source contexts. + - very experimental workaround for the totally broken netbsd platform. + - tried to hack around openbsd bugs. + +4.804 Wed Nov 5 16:36:00 CET 2008 + - Coro::Debug::new_unix_server would not create a non-blocking listening + socket, sometimes causing freezes. + - (libcoro) fix misaligned stack points for setjmp and assembly + methods, which can cause crashes on x86/x86_64 with a sufficiently + aggressive compiler. + - new function: Coro::Debug::new_tcp_server. + - move ->throw into the Coro class because it only works on coro objects. + +4.803 Mon Nov 3 17:16:12 CET 2008 + - (libcoro) use a global asm statement to become independent of gcc + otpimisations for CORO_ASM (thanks to pippijn for the idea). + - try to workaround yet another broken bsd, this time dragonfly. + +4.802 Thu Oct 30 10:56:12 CET 2008 + - support -fno-omit-frame-pointer on x86 with the assembly method. + - tune 01_unblock.t tests a bit. + +4.801 Wed Oct 22 18:33:37 CEST 2008 + - improve readline speed for very long "lines". + - backport to 5.8.8. + +4.8 Thu Oct 2 13:34:40 CEST 2008 + - new function Coro::AIO::aio_wait. + - Coro.:AIO and Coro::BDB now "use Coro::AnyEvent". + - greatly speed up and reduce memory usage of Coro::AIO requests. + - implement some other µ-optimisations. + +4.749 Mon Sep 29 14:40:12 CEST 2008 + - port to slow and broken pseudo-threaded perls. (courtesy pippijn). + +4.748 Sat Sep 27 14:03:19 CEST 2008 + - implement, but do not document, PerlIO::cede(granularity). + - Coro::Storable forgot to wrap Storable::pstore. + - work around the multitude of leaks and memory corruption + bugs in PerlIO::via by using our own C-level perliol. As a side + effect, Coro::Storable is now much, much, much faster. + +4.747 Tue Sep 23 01:59:41 CEST 2008 + - fix a per-cv memleak (one empty array was leaked per + code reference). + - avoid a crash in coro->call|rss when the coroutine was already + destroyed (most noticably when using Coro::Debug::ps :) + - also protect *Storable::FILE. + - push up default storable granularity to 20ms. + +4.746 Sun Sep 21 03:22:20 CEST 2008 + - be more insistent on locking Storable against reentrancy + in Coro::Storable. + - move swap_def?v and throw to Coro::State, as documented. + +4.745 Thu Jul 24 00:14:38 CEST 2008 + - remove debugging code related to MgPV_nolen_const, also try to + make it compile with perl 5.8.6 (yes, apple apparently loves + outdated software). Reported by John S. + +4.744 Tue Jul 8 22:06:35 CEST 2008 + - correctly provide default DIE/WARN handlers as documented. + - also overwrite PL_vtbl_sigelem.svt_clear, even though current + implementations inside perl work fine for us. + +4.743 Mon Jun 16 00:21:57 CEST 2008 + - when using Coro::EV without running EV::loop it could + result in busy-waiting for events, this has been fixed. + - reduce codesize and improve performance by using EV_DEFAULT_UC. + +4.742 Sat May 31 14:10:21 CEST 2008 + - implement a workaround for (some) perl <5.8.8 versions. + - require EV 3.3+. + +4.741 Fri May 30 23:33:09 CEST 2008 + - tell netbsd how utterly broken their imitation of an OS is + and refuse to build by default if pthreads are in use. + - switch to "s" method on all bsd's by default, as their ucontext + stuff seems just too broken. + - fix a bug in Coro::Select. + +4.74 Thu May 29 20:05:31 CEST 2008 + - do not test Coro::LWP for lack of dependencies. + - do not test Coro::Select for lack of working perls. + +4.73 Thu May 29 2008 + - fix a bug in Coro::EV which would cause it to block despite + there being runnable coroutines. + - sprinkle "no warnings" freely over everything, also suppress + warnings for some other modules. + - fix typo in WSAEWOULDBLOCK. + +4.72 Sun May 25 05:14:36 CEST 2008 + - tweak META.yaml a bit, unfortunately, there is no documented way + to have optional dependencies with CPAN. doh :( + - avoid running some tests on windows because they would fail due to + perl bug (broken fork, broken pipes...). + - work around perl on windows bugs where perl returns undocumented + error codes for sysread, syswrite etc. by taking advantage + of AnyEvent's workaround for that problem. + - use AnyEvent::Util::fh_nonblocking in Coro::Handle to work around + a common perl implementation bug on windows. + - use unix domain sockets in testsuite to work around + common perl implementation bugs on widows (they are emulated by + tcp sockets on windows. ugh.) + +4.71 Sat May 24 20:01:27 CEST 2008 + - fix a bug in Coro::AnyEvent ("Usage: Coro::AnyEvent::_schedule()"). + - take advantage of async name resolution of AnyEvent::Util. + - work around brutal inet_aton override in Coro::LWP. + - take advantage of the readyhook in Coro::EV, for smoother + scheduling. + +4.7 Sun May 11 00:32:19 CEST 2008 + - completely reworked the Coro manpage. + - added Coro::AnyEvent, generic event loop integration. + - implement cancel, ready and kill commands in Coro::Debug. + - document find_coro in Coro::Debug. + - incompatible change: rename has_stack to has_cctx. + - Coro::AIO and Coro::BDB no longer force event model detection, + use AnyEvent::AIO and AnyEvent::BDB. + +4.6 Sat Apr 26 10:05:14 CEST 2008 + - INCOMPATIBLE CHANGE: sub/code attributes are no longer supported + by the Coro module. It was a mistake to have it in the first place. + - (experimental) support for activestate perl 5.10 (method "w"). + - (experimental) support for strawberry perl (method "a"). + - coro_sigelem_set did not return a value although it had to, + actual impact unknown. + +4.51 Mon Apr 14 13:28:27 CEST 2008 + - make it compile again on 5.8. + +4.50 Thu Apr 10 09:43:17 CEST 2008 + - I did it twice! (see 4.49). + +4.49 Sun Apr 6 21:23:31 CEST 2008 + - grr, instead of compiling the recent changes on 5.10 only they + were compiled on 5.8 only. + +4.48 Sun Apr 6 20:36:46 CEST 2008 + - allow coroutine switches during eval's under 5.10.x, as it seems + the parser is a per-interpreter option now, so this is safe + (this might fix the odd crashing bug). + - drop support for 5.9.x versions: they are dead, jim. + +4.47 Sun Apr 6 00:37:52 CEST 2008 + - force cctx allocation on API calls: we know we need to force one + and gcc actually manages to confuse our heuristic nowadays, + leading to crashes and worse. + - document force_cctx. + +4.46 Fri Apr 4 22:05:43 CEST 2008 + - upgrade libcoro, resulting in pthread-backend (which was only created + to fulfill the rules of the programming languages shootout). + +4.45 Thu Mar 13 11:55:36 CET 2008 + - fix a file leaking bug in eg/mhyttpd that would allow + downloading of any file (reported by oesi). + - fix deadlock bug in Coro::Channel (reported by Richard Hundt) + (also add testcase). + - support Broadcast option in Coro::Socket (patch by Richard Hundt, + apparently having loads of fun with that). + - implement $state->swap_defsv, ->swap_defav and document ->throw. + +4.4 Wed Feb 13 16:44:29 CET 2008 + - only assume .cfi pseudo isns exist on GNU/Linux. + - add get_timed method to Coro::Channels. + - fixed Coro::Debug manpage. + - perl 5.11 compatbility improvement based on patch by + Andreas König. + +4.37 Sun Jan 20 11:25:23 CET 2008 + - soften the check for an active parser for perl 5.10 (avoiding + "Coro::State::transfer called while parsing" in many cases). + +4.36 Sun Jan 13 10:53:56 CET 2008 + - reset diehook when terminating from an async_pool as to not + trigger any __DIE__ handlers. + +4.35 Sun Jan 13 04:14:13 CET 2008 + - "bt" debug command now displays any exceptions + from longmess and also skips the innermost + stackframes, giving more useufl output. + - allow backtraces in coroutines blocked in Coro::EV, + at a <1% speed hit. + - handle localising of $SIG{__WARN__} and __DIE__ + properly (with a proper amount of dirty hacking). + +4.34 Sat Dec 22 17:49:53 CET 2007 + - upgrade to EV version 2.0 API. + +4.33 Mon Dec 17 08:36:12 CET 2007 + - make Coro::AIO etc. loadable in the absence of EV. + +4.32 Mon Dec 17 07:46:02 CET 2007 + - majorly improved Coro::Handle's performance with Coro::EV. + - implemented the until now mythical Coro::BDB module. + - specialcase EV in Coro::AIO and Coro::BDB for extra speed. + +4.31 Wed Dec 5 12:32:39 CET 2007 + - remove warn statement form Coro::Util. + +4.3 Tue Dec 4 20:33:14 CET 2007 + - calls to the idle function could cause stack corruption + when the stack changed. + - do no longer rely on the presence of EV::DNS if EV is used + (because it is gone), but instead take avdantage of EV::ADNS + if available. + - add ($) prototypes to all functions in Coro::Storable. + - use a conventional (safer) idle callback in Coro::EV. + - do accept quickly in Coro::Debug to avoid endless loops. + +4.22 Fri Nov 30 16:04:04 CET 2007 + - really use optimised versions for Event and EV in Coro::Util + and Coro::Handle. + +4.21 Sun Nov 25 10:48:59 CET 2007 + - fix a spurious memory read. + - Coro::EV no longer keeps the eventloop "alive". + +4.2 Fri Nov 9 20:47:05 CET 2007 + - enable/disable tracing from a new coroutine, not a pooled one. + - fix a memleak in Coro::Event. + - removed killall call from fork_eval. + - made sure store_fd is already loaded so that fork_eval + does not have to parse autoload in each subprocess. + - only use assembly method if -O switch is in $Config{optimize}. + - add (optional) Coro::EV module, so far the best event loop module + directly supported by Coro. + - if the event model is EV, use EV::DNS to resolve + stuff in Coro::Util. + - don't get confused by multiple event notifications in Coro::Handle. + - initial support for EV (libevent interface). + - require Event and EV using configure_requires, to force their existance. + +4.13 Wed Oct 24 07:26:45 CEST 2007 + - add Coro::Storable::blocking_thaw. + - use a vastly more complicated technique to localise + $SIG{__WARN/DIE__} that also works on perls <= 5.8.8. + - use a coroutine for the idle callback Coro::Event, + instead of running Event in the current coroutine context. + This also catches recursive invocations. + - actually report fork errors in gethostbyname and inet_aton. + +4.11 Thu Oct 11 02:40:24 CEST 2007 + - port to threaded perls. + +4.1 Thu Oct 11 02:38:16 CEST 2007 + - incompatible change: $SIG{__DIE__} and $SIG{__WARN__} will now + be local to each coro (see Coro::State). + - incompatible change: for very deep reasons, cede and cede_notself + cannot return anything, so nothing will be returned. + - possibly bring back 5.10 compatibility (untested). + - work around stupid (and wrong) warning on 5.10 :(. + - overlay the saved state over the context stack. This saves + a few hundred bytes per coroutine on average and also + speeds up context switching a bit. + - further tune default stack sizes. + - (more) correctly calculate stack usage in coro_rss. + - Coro::Storable::blocking_* did not properly lock + resulting in races between coroutines. + - added Coro::Storable::guard. + - stopping to trace a coroutine could destroy the cctx of + an unrelated coroutine. + - explain the relationship between Perl and C coroutines in + more detail in Coro::State. + - Coro::Util::inet_aton did not short-circuit dotted quad forms, + causing a fork per resolve. This also affected Coro::Socket. + - switch to a separate stack in $coro->call/eval to avoid + invalidating pointers. + +4.03 Sat Oct 6 21:24:00 CEST 2007 + - added Coro::throw method. + - minor code cleanups. + +4.02 Sat Oct 6 02:36:47 CEST 2007 + - fix a very minor per-coroutine memleak (a single codereference). + - fixed a bug where the currently in-use c context would be freed + prematurely (can happen only when programs change the stacksize + or use tracing). + - tracing can no longer keep a coro alive after it terminated. + - do static branch prediction in the common path for gcc. gives + about 2-5% speed improvement here. + +4.01 Fri Oct 5 22:10:49 CEST 2007 + - instead of recreating *a* standard output handle we simply + use STDOUT, which is faster and hopefully more robust. + +4.0 Fri Oct 5 12:56:00 CEST 2007 + - incompatibly changed Coro::Storable::freeze. + - major new feature: added Coro::Debug, for interactive coroutine + debugging, tracing and much more. + - major bug fix: unbelievable, but true: $_, $/ and many other + "saved" variables actually weren't being saved. This has been fixed, + of course, while increasing performance while losing all the save + flags. + - save flags are gone, and all the api functions dealing with them. + - added Coro::Semaphore::adjust. + - added Coro::Util::fork_eval. + - added Coro::Storable::{nfreeze,blocking_{freeze,nfreeze}}. + - added Coro::killall. + - reduce initial stack sizes to allow for "micro-coroutines". + - better async_pool resource management, moved parts of async_pool + handling to XS (major speed improvement). + - actually croak before modifying important data structures. + - refuse to transfer while compiling. + - possibly support eval EXPR better now. + - enable assembly per default on linux+bsd x86+amd64. + - all internal members were renamed _something for easier subclassing. + - many minor tweaks. + +3.63 Wed May 16 14:10:06 CEST 2007 + - implement handcoded assembly for x86/amd64 SVR ABI. + +3.62 Fri Apr 27 21:36:06 CEST 2007 + - upgrade libcoro (which might set unwind info correctly). + - change default on linux to setjmp/longjmp. + +3.61 Thu Apr 19 12:36:18 CEST 2007 + - Coro::Storable caused an endless loop when thawing invalid + pst's sometimes. + - use a Semaphore in Coro::Storable, as Storable doesn't + seem to be reentrant (although it is documented to + be threadsafe...). + - fix Coro::Signal to bring back the original unreliable + but stateful semantics. + - fixed a lot of typos in Coro.pm (patch submitted by David + Steinbrunner, which applied flawlessly). + +3.6 Sat Apr 14 17:13:31 CEST 2007 - added some bugfixes to get eg/myhttpd working again. - added Coro::Storable for often-cede'ing freeze/thaw. - try to do a clean exit when a coroutine calls exit