--- Coro/Changes 2008/12/15 19:39:40 1.483 +++ Coro/Changes 2016/06/22 20:37:27 1.658 @@ -1,11 +1,430 @@ Revision history for Perl extension Coro. 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: channel->maxsize(newsize)? +TODO: __GCC_HAVE_DWARF2_CFI_ASM +TODO: swap_sv, maybe add scope_swap_sv? +TODO: croak when async_pool tries to run canceled thread? + + - work around assertion failure in perl_destruct on 5.24 + (analyzed by Dave Mitchell). + +6.5 Wed Jun 22 22:23:50 CEST 2016 + - swap_sv swapping order was not symmetrical, causing + wrong swaps when swap_sv was used multiple times on the + same sv in the same thread. + - swap_sv calls can now be undone by calling it again + with the same variables. + - swap_sv calls will now be undone in async_pool threads. + - split Coro::Semaphore::up/adjust into separate xs functions + for better error reporting, at slight codesize increase. + - (libcoro) arm assembly support, please test and report. + - adjust to PL_savestack changes in perl 5.24 (adapted from + the debian patch, which unfortunately gets it wrong). + +6.49 Sat Oct 17 01:40:12 CEST 2015 + - throwing an exception to a thread waiting in + Coro::Handle using Coro::EV did not stop the watchers, + causing the next call to fail (testcase by Martin Pritchard). + - bump minimum perl version to 5.10. + +6.48 Sun Oct 4 19:03:51 CEST 2015 + - fix memory leak when Coro::Handle uses Coro::EV internally + (testcase by Sten Sten). + - update code to libev 4 API (internally, Coro still used the + version 3 API calls). + - remove unused hv_sig. + +6.47 Sat Jul 11 03:58:20 CEST 2015 + - swap_svs - NVs can be in the SV head beginning with 5.20. + +6.46 Tue Jun 30 14:36:30 CEST 2015 + - restore portability to perls with windows fork emulation + (patch by Petr Písař). + +6.45 Tue Jun 30 01:40:08 CEST 2015 + - restore portability to perl 5.16 and below. + +6.44 Tue Jun 30 00:41:54 CEST 2015 + - avoid segfaulting (or worse) when tracing a canceled thread. + - the Event module silently broke it's public hook API, causing + failures on perls compiled with -Duselongdouble. Requiring + the latest version of Event because I don't know which release + changed this (it's not mentioned in the ChangeLog). + - allow xs level enterleave hooks via CoroAPI. + +6.43 Thu Jun 4 15:38:14 CEST 2015 + - use stability canary. + - port to stableperl-5.22.0-1.001. + - update libecb. + +6.42 Wed Feb 11 20:29:52 CET 2015 + - Coro::SemaphoreSet->try did not actually work (analyzed by + SATO Kentaro). + - upgrade libecb to be C11 compliant. + +6.41 Sat Sep 6 22:08:46 CEST 2014 + - restore portability to perl 5.8.x. + - give new Coro's a valid GvHV(PL_hintgv) - this is slow and takes + up some memory, but fixes "use feature" and similar modules + when used inside a Coro. + - allow zero as argument to Coro::Channel to mean the same thing + as no argument. this works with older versions as well, + but wasn't legal until now. + - slightly better c header file detection. + +6.39 Mon Jun 2 00:00:08 CEST 2014 + - work around more incompatible changes in 5.20. + +6.38 Sun Jun 1 21:54:23 CEST 2014 + - check that perl slots actually have enough space to hold + interpreter variables. + - untested port to perl 5.19 (64 bit tmps indices) (reported + by Andreas König). + - croak when cancel is called without a thread context. + +6.37 Tue Mar 4 13:27:33 CET 2014 + - *sigh*, removed leftover debugging code from debugging a + perl bug, of all things. + +6.36 Tue Mar 4 07:11:59 CET 2014 + - semaphores would not clear the destroy hook when interrupted + by ->throw, causing segfaults or worse. + - ->throw on a thread waiting for a semaphore did not acquire + the semaphore, but also didn't wake up other waiters, + possibly causing a deadlock. + - "FATAL: $Coro::IDLE blocked itself" will now use Carp::confess + to report a full stacktrace, which should help find out + where the actual call is. + - "atomically" destroy data in slf_destroy, because it is + the right thing to do, just in case. + - disable ecb.h libm dependency, to compile on ancient systems + or under adverse conditions. + +6.33 Mon Nov 18 11:26:27 CET 2013 + - do not crash when freeing padlists with holes (in 5.18). + - tentative SVt_BIND 5.19 port/fix. + +6.32 Tue Nov 5 15:35:35 CET 2013 + - use a new algorithm to derive padlists for perl 5.18. The old + one could lead to 0-pointer accesses inside perl (reported + by Darin McBride). + +6.31 Thu May 9 07:39:48 CEST 2013 + - Coro::AIO requests would crash if the thread was ready'd + while the request was ongoing. + +6.29 Wed May 8 02:55:18 CEST 2013 + - when an on_destroy handler destructs the coro currently being + destructed a perl scalar could be accessed after being freed, + likely causing a crash. + +6.28 Wed Mar 6 06:58:02 CET 2013 + - clean remnants of existing __DIE__ and __WARN__ handlers so + they lose their magic and will not cause segfaults later + (testcase by Andrey Sagulin). + - improved Coro::State documentation a bit. + - Coro::Debug::command now flushes the output. + - add hack detection code for x32 abi, because the braindead slugs + who designed that made it look exactly like x86_64 without + providing proper compile time symbols to test for it. as a result, + this detection cannot work reliably. + - valgrind stack registering was broken. + - do not rely on Time::HiRes anymore in Coro::Debug. + +6.23 Fri Dec 7 23:36:37 CET 2012 + - use experimental fiber implementation on native windows + perls. + - use sizeof (void *) as multiplication factor for stack sizes, + to accomodate the totally braindamaged microsoft 64 bit "os". + - changed verifier host from win2k-ap510-32 to win7-sp516-32/64. + activeperl 5.16 crashes when PerlIO_define_layer is called due + to some bug in the perl dll, strawberry perl at least passes + the testsuite. + - implement Coro::Handle->peeraddr/host/port, for slightly + improved compatibility with LWP. + - implement 5.17 compatibility by almost blindly applying a + good-looking patch by Father Chrysostomos. + - move stack management functions into libcoro 3. + - libcoro version 3 "released". + - support magic values as timed_io_once args. + - recommend AnyEvent 7+ or EV 4+, also require EV + version 4 or newer for Coro::EV. + +6.10 Tue Oct 9 01:14:27 CEST 2012 + - updated ecb.h, it had a typo that caused it to not compile on many + big endian systems (reported by many people). + - disable memory fences in ecb.h to improve portability. + +6.09 Sat Oct 6 23:25:02 CEST 2012 + - Coro::EV I/O watchers were not interruptible by exceptions + (Coro::State::throw) (testcase by sten). + - ->throw now puts threads into the ready queue, as this seems to + be expected by existing code, and code that doesn't cope with spurious + wakeups needs fixing anyway. + - use fd -1 in mmap. + - cast I32 to int in error message printf. + - warn about broken so-called "hardened" kernels. + +6.08 Fri Apr 13 12:05:47 CEST 2012 + - be more aggressive about exiting like perl does - formerly, + exiting from the non-main thread would not execute END blocks. + +6.07 Fri Nov 11 21:21:48 CET 2011 + - work around a bug in PerlIO (setting $SIG{__WARN__} to a PVCV). + - update ecb.h. + +6.06 Mon Aug 8 23:59:48 CEST 2011 + - cygwin unfortunately patches the stack at runtime, so we use the pthreads + backend, which is an order of magnitude slower. unfortunately, cygwins + pthread implementation isn't very complete either, so allocate the stack + twice just to be sure. + (note: cygwin also enables mymalloc, which is NOT THREADSAFE ON WINDOWS, + in its ithreaded perl - best recompile cygwin and use the 'w'indows + backend for much better performance. also disable ithreads for + even better performance...). + +6.05 Thu Aug 4 21:36:36 CEST 2011 + - blush, condvar values would not be propagated from send to recv anymore + (reported by Chip Salzenberg). + - use exponential increase for the readline buffer length in + Coro::Handle. also reduce initial allocation to 1020 from 4096 bytes. + +6.04 Wed Aug 3 17:15:45 CEST 2011 + - use even more efficient and more compatible condvars for + compatibility to AnyEvent 6.x :) + - more inconsequential ecb.h updates. + +6.03 Wed Aug 3 11:41:30 CEST 2011 + - change how Coro patches AnyEvent condvars for compatibility to + AnyEvent 6.x. + - update ecb.h, to no longer include in case WinNT.h + hasn't been included. + +6.02 Wed Jul 13 04:35:19 CEST 2011 + - "improve portability to Gentoo" - gentoo manages to put perl variables + in memory areas that are farther than 2gb apart, which the jit couldn't + handle and barfed. now it's just a bit slower on gentoo and similar + systems. + +6.01 Sun Jul 3 12:31:14 CEST 2011 + - workarounds are good, but the test for whether pthreads are used + was not good. this one should be better. + - check differently whether gcc generates cfi instructions itself. + +6.0 Wed Jun 29 19:43:35 CEST 2011 + - INCOMPATIBLE CHANGE: unreferenced coro objects will now be + destroyed and cleaned up automatically (e.g. async { schedule }). + - implement a JIT compiler for part of the thread switch code, + which gives a 50% speed improvement on threaded perls, and + about 4% on non-threaded perls (so threaded perls now finally + reach about half the speed of non-threaded perls). + - slightly modernise Coro::Intro, add section about rouse functions. + - avoid DEFSV and ERRSV, giving another 10% improvement + in thread switching. + - Coro::State->is_destroyed is now called is_zombie. + - implement a Coro->safe_cancel method that might fail, but + cancels in a "safer" way if it succeeds. + - add preliminary support for DEBUGGING perls. + - get rid of two hash-accesses when initialising a new Coro - this + speeds up coro creation by almost a factor of two. + - croak when a coro that is being cancelled tries to block + (e.g. while executing a guard block), instead of crashing or + deadlocking. + - use a more robust and also faster method to identify Coro::State + objects - speeds up everything a bit. + - implement Coro->cancel in XS for a 20% speed improvement, and to + be able to implement mutual cancellation. + - speed up context switches by a percent or two by more efficiently + allocating context stack entries. + - implement Coro->join and Coro->on_destroy in XS for a speedup and + a reduction in memory use. + - cancelling a coro while it itself is cancelling another coro is + now supported and working, instead of triggering an assertion. + - be a bit more crash-resistant when calling (buggy) on_destroy + callbacks (best effort). + - move on_destroy into the slf_frame, to allow extension slf + functions to have destructors. + - get rid if coro refcounting - simply crash in other interpreter + threads by nulling the pointers on clone. + - simplify warn/die hook handling when loading Coro - the convoluted + logic seems to be no longer neccessary. + - use libecb instead of our own home-grown gcc hacks. + - document alternatives to Coro::LWP. Please use them :) + - work around another mindless idiotic NEEDLESS bug in openbsd/mirbsds + sigaltstack. Really. wine suffers from it, erlang suffers from it, + and it's known since at least 2006. + +5.372 Wed Feb 23 06:14:30 CET 2011 + - apparently mingw doesn't provide a working gettimeofday, try to + work around that by relying on Time::HiRes (indirectly brought to + my attention by Max Maischein). + - fix some portability issues when Time::HiRes was used. + +5.371 Mon Feb 21 14:36:08 CET 2011 + - backport to windows process emulation code again. + +5.37 Sat Feb 19 07:49:44 CET 2011 + - add a big "Coro thread life cycle" section to "man Coro". + - try a tentative workaround against the breakage that 5.13 has + introduced without depreciation period. sigh. + - no longer use Time::HiRes if gettimeofday is available, which + saves quite a lot of memory. + +5.36 Sun Feb 13 05:33:41 CET 2011 + - automatically load Coro::Channel, Coro::RWLock, Coro::Semaphore, + Coro::SemaphoreSet, Coro::Signal and Coro::Specific on first "new" + method call. + - undocument Coro::Timer::sleep and obsolete whole module. + - optimise Coro::Timer::timeout memory and cpu usage. + - slightly updated Coro::Intro for recent changes. + - do not initialise PL_dirty anymore. + +5.25 Thu Nov 11 01:08:39 CET 2010 + - try a different approach on netbsd - netbsd 5 finally has marginally + working pthreads, but still broken ucontext/sigaltstack. + - openbsd 4.8 finally got their act together, Coro works out of the box + with asm, setjmp and pthreads (no change, just informational). + +5.24 Sat Oct 23 11:27:12 CEST 2010 + - port to the EV 4.0 API. + - work around bugs in mingw32, making strawberry perl work + out of the box. + - correctly modify Coro::AIO function prototypes + so that they reflect the "no optional parameters" rule. + - "ported" libcoro to C++. + +5.23 Mon May 17 18:50:42 CEST 2010 + - be more resistant to ordering changes when initialising + Coro::AnyEvent, Coro::EV and Coro::Event (reported by Matthias + Waldorf). + - document that perl 5.12 deliberately removed support for cloning. + +5.22 Wed Apr 14 03:55:35 CEST 2010 + - correctly return udnef on errors in Coro::Handle::read/write + (testcase by Marc Mims). + - convert Coro::Util into a "perl compatibility wrapper" - the functions + are less useful now, but are drop-in replacements for existing + functions, listing better alternatives in the documentation. This also + fixes a bug in Coro::LWP which naively substituted Socket::inet_aton + with Coro::Util::inet_aton. + - do not override $Coro::idle unconditionally in Coro.pm, as other + modules could have provided their own idle coro already + (for exmaple, Coro::AnyEvent). + - fix Coro::Util::gethost* functions. + - Coro::Timer corretcly exports it's symbols (reported by Hideki Yamamura). + +5.21 Wed Dec 16 07:19:51 CET 2009 + - automatically load Coro::AnyEvent when AnyEvent and Coro are used + together. + - add some examples on how to combine other event loops with Coro in + Coro::AnyEvent, and how to run it (and not to block). Seems to be + the most common source of confusion. + - try to catch people naively blocking in an event callback. + - work around the perl filehandle bug issue in conjunction with + older common::sense (as indirectly pointed out by ZSystem). + - clarify the "not from signal handlers" section. + +5.2 Sun Oct 4 14:54:24 CEST 2009 + - Coro::Storable destroyed the prototypes of the functions it wrapped. + - export rouse_cb and rouse_wait by default now. + - fix various prototype mismatches in Coro::AnyEvent and Coro::Handle. + - new method $state->swap_sv. + - added section on "windows process emulation" to the manpage, + after a not-so-fruitful (nor-friendly) "discussion" with chip + salzenberg (discussion implies arguments, but his only arguments + were ad-hominems, one wonders why he started it in the first + place). I hope this explains it well enough for him to understand, + and maybe well enough for others to understand. + - use common::sense everywhere now. + - idle callbacks are no longer supported, use idle coros instead. + - print a thread listing when a deadlock is detected. + +5.17 Sat Aug 22 23:09:31 CEST 2009 + - work around a bug in the perl debugger causing crashes + when running under the debugger by marking _pool_handler as nodebug. + - speed up Coro::async considerably. + - try some hacks to get netbsd to work "more often" - their broken + setjmp/longjmp, ucontext *and* phtreads are really hard on Coro. + - convert Coro to AE 5.0 API. + +5.162 Tue Jul 28 04:04:03 CEST 2009 + - perl 5.8.2 is now minimum requirement. + - skip t/19_handle.t on broken windows perls. + +5.161 Wed Jul 22 04:47:38 CEST 2009 + - Coro::AnyEvent::poll could have a different prototype when EV was + used as backend (analyzed by Tatsuhiko Miyagawa). + - Coro::AnyEvent errornously initialised the event loop when loaded, + not on demand. + - try to workaround rare */t/01_unblock.t failures. + +5.16 Tue Jul 21 01:44:37 CEST 2009 + - Coro::AnyEvent failed to hook into the event loop + when no threads had been readied between detecting + the event loop and actually running it. + - considerably speed up Coro::Select by taking avdantage + of AnyEvent > 4.8 and some other optimisations. + - implement paragraph readline mode in Coro::Handle + (based on patches by Zsbán Ambrus). + - replace WSAEINPROGRESS by WSAEWOULDBLOCK (reported + and analyzed by Yasuhiro MATSUMOTO). + - clarified libcoro license and copyright. + - someone stole my EXTRA_META!!! + - implement Coro::Select::patch_pp_sselect and it's brother, + for hardcode select overriding. + +5.151 Mon Jul 6 05:41:57 CEST 2009 + - backport to windows process emulation code again (patch by + Yasuhiro MATSUMOTO). + - slightly update Coro::MakeMaker. + +5.15 Tue Jun 30 10:28:06 CEST 2009 + - deprecate Coro::Socket, document how to get ipv6 support via + AnyEvent::Socket instead. + - implement signal->wait ($cb) interface, similar to semaphores. + - work around SvOK not supporting getmagic, so we have to getmagic + to test for undef :/ (reported by Matthias Waldorf). + - load Coro::AnyEvent in all modules using AnyEvent. + - work around perl corrupting our internal data structures, + reported by Tokuhiro Matsuno. + - enable per-coroutine real and cpu time gathering + (Coro::State::enable_times). + +5.14 Wed Jun 24 01:37:48 CEST 2009 + - provide explicit functions to "cede" to the event loop in Coro::AnyEvent, + as this seems to have been a difficult concept (poll, sleep, idle, + idle_upto). + - add Coro::AnyEvent::readable/writable functions. + - clarify Coro::EV/Event/AnyEvent manpages. + - free per-thread global scalars in the thread calling ->cancel, to + avoid crashes when $_, $@ etc., are magical but some of those + had already been freed. + - "unexperimentalise" the callback interface for Coro::Semaphore. + - speed up ready queue management/context switching by using a linked + list instead of an array (~5-10%). + - implement "watch" command in Coro::Debug shells. + - for fun, implement time-slicing as an example in the manpage. + - if AnyEvent detects EV or Event, but we don't have Coro::EV or + Coro::Event, use the normal AnyEvent handling instead of dieing + (the same is true for Coro::Handle). + - properly document Coro::EV::timed_io_once. + - avoid unneccessary ->cancel calls in Coro::Handle. + - maybe make it work on mingw32 with win32 backend + (based on patch by Yasuhiro Matsumoto). + +5.132 Fri May 29 09:00:39 CEST 2009 + - do not keep a reference to the argument itself in + Coro::Semaphore::guard, as it could change later. + - support SO_RCVBUF/SO_SNDBUF nonstandard Coro::Socket options, + should support a prepare callback. + +5.131 Mon Mar 16 23:20:37 CET 2009 + - implement and document Coro->suspend, Coro->resume. + - fix Coro::Select implementation to not (often) close + the passed file descriptors (testcase provided by pippijn). -5.13 +5.13 Mon Dec 15 21:51:42 CET 2008 - EXPERIMENTAL: implement dynamic winds (on_enter/on_leave). - don't set diehook to C but instead to NULL, to avoid spurious warnings. @@ -20,7 +439,8 @@ - fix some minor issues in Coro::State->call/eval. - use current coroutine context instead of a temporary one when temporarily switching to another coroutine. - - do not call C-level on_destroy handlers during global destruction. + - do not call C-level on_destroy handlers during global destruction, + to avoid needless segfaults. 5.12 Sun Dec 7 13:30:38 CET 2008 - add default config for MirOS, which seems to be a bug-to-bug @@ -161,7 +581,7 @@ - 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) 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. @@ -233,7 +653,7 @@ outdated software). Reported by John S. 4.744 Tue Jul 8 22:06:35 CEST 2008 - - correctly provide default DIE/WARN handlers as documented. + - 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. @@ -265,7 +685,7 @@ - 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 + - 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...). @@ -279,7 +699,7 @@ 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()"). + - 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 @@ -287,7 +707,7 @@ 4.7 Sun May 11 00:32:19 CEST 2008 - completely reworked the Coro manpage. - - added Coro::AnyEvent, generic event loop integration. + - 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. @@ -421,7 +841,7 @@ - port to threaded perls. 4.1 Thu Oct 11 02:38:16 CEST 2007 - - incompatible change: $SIG{__DIE__} and $SIG{__WARN__} will now + - 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. @@ -503,7 +923,7 @@ Steinbrunner, which applied flawlessly). 3.6 Sat Apr 14 17:13:31 CEST 2007 - - added some bugfixes to get eg/myhttpd working again. + - 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 (EXPERIMENTAL).