On 9 Sep 2004, at 08:14, Jonathan Leffler wrote:

==> Yes this class of issues can be trivially solved by demanding threading,
==> but that does not help when a(n unrealistic?) design constraint limits
==> you to one thread.


This worries me.  I really think that asynchronous support via
threading is more sensible.  It is also more likely to be widely
achievable - IMNSHO.  However, it is your itch, so you get to lay out
your desires.  However, be aware that not everyone suffers from the
same sources of irritation as you do.

So one way to do this to keep everyone happy might be to use threads to do things in the background, but use a file descriptor to notify of readiness. The DBI could do this transparently, or you could implement it natively if you preferred (or had access to your own descriptor that you could use).


In terms of why I'm banging on about file descriptors, let me explain my itch. I work on very highly scalable network applications that process thousands of concurrent connections. In these programs NOTHING can block my event loop, because everything falls apart if I do. And I have to be very careful about slow system calls. If I can have a file descriptor it can fit in cleanly with my current event loop. If I can't, and have to rely on something like $sth->ready, which might call its own select() function, then I'm screwed, because select() is a slow system call.

I'm absolutely willing to admit that my application is way out there compared to most people's.

Matt.



Reply via email to