On Thu, Jan 29, 2009 at 09:26:12PM +0000, Tim Bunce <tim.bu...@pobox.com> wrote: > > On Thu, Jan 15, 2009 at 10:01:32PM +0000, Tim Bunce <tim.bu...@pobox.com> > > wrote: > > > Marc, what would need to be added to the DBI (or DBD::Gofer) to support > > > asynchronous use via the Coro module? > > Extra question: can Coro work when there's XS code in the class stack?
Coro has no issues with XS code in between, but XS code sometimes has issues - Event and Storable for example corrupt their variables (recursion is ok, but concurrency isn't, basically xs modules must support some weak form of thread-safety - Event and Storable only support recursion). Basically, Coro creates a cooperative c-level thread dynamically when it detects that XS code is somewhere between it and the top level interpreter. > > Yet another option would be to write a DBD::Gofer::Transport::corostream > > which would hardcode the above. It probably should be part of the Coro > > module itself (and was on my todo list). Now that I looked at it, it might > > be as trivial as subclassing ::stream and overriding start_pipe_command. > > Great. Want to give it a try? (I've no time myself.) Sure, it's on my todo since 2006 or so... :) I guess I am a giant step nearer to the goal now, having actually investigated the thing, but it is hard for me to say "I will try" when it might end up being released only shortly before perl6 in 2029. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / p...@goof.com -=====/_/_//_/\_,_/ /_/\_\