#perl - Sat 10 Mar 2007 between 10:56 and 11:10



ayrnieuintegral - I won't explain it to you.
integralsplitter: Yes, POE's got POE::Wheel::Run and POE::Component::Generic which allow you to easy use a fork to run a blocking library whilst your main code is handling sockets and what not.
actionintegral would be interested to know though
integralwould be interested to know though
splitterintegral, sounds good, is that possible with threads too?
integralsplitter: Yes, it's where a threading model tends to win
err, well, "win" might be too strong
splitterintegral, hm, just as a thought, wouldnt it be cool if it would be possible to make a manager thread run POE to manage a load of worker threads, which are handling/calculating different things?
integralThat would be very interesting, but I'm not entirely sure why you'd want threads then instead of processes?
Would you be using shared data?
splitterintegral, mh, dunno how much more resources a fork uses up in comparisation to an ithread.
but maybe it would be significant if i have a few hundred or even thousand forks
integralI think that one needs to be carefully benchmarked on your OS
ayrnieua hundred or even a thousand forks or threads are both probably unwise. Use threads for parallelism and for defense against blocking libraries, not for concurrency.
integralAlthough, I guess forks on something like Linux would win; both after all use the OS scheduler (1:1 threads) so that's not an issue in either case
ayrnieuFor concurrency, POE is fine.
integralSo, in this case you'd advocate POE for the concurrency attached to a pool of processes handling the blocking library?
splitterhm, in this case i was thinking of an sort of bouncer, which has to be able to handle a load of connections. ill try to make a concept which uses POE where possible
actionmerlyn rushes to pack, having bumped up his flight 3 horus
merlynrushes to pack, having bumped up his flight 3 horus
you could use HTTP on the front, and a POE::Component::Generic in the back
integralHTTP?
merlynor some other light protocol in the front
from whatever he's connecting from
integralHTTP only does single operations (or a series of unconnected ones) though, so sure it's not quite general enough
merlynsorry, only been following the last 45 seconds
splitterhm, i have to use a pre-defined protocol (and already a lib to parse it)
merlynno scrollback to speak of
integraloh
merlynis the lib non-blocking?
splitteryupp. thats not the problem
merlyncool
so yeah, you could use POE as a mediator
splittersounds good. i like POE, but i thought i couldnt use it in this case :)
merlynwrite a Inline::C wrapper to your lib, and as you get callbacks, turn those into evens to post to the ::Generic in the back
then you can hang an IRC bot off the side for command and control. :)
and a Tk gui console for a NOC display
and an NNTP client to post regular updates to the newsgroup
splitteri thought it in this way: frontend <-UNIX/INET Socket-> backend which handles a lot of connections
merlynand a jabber interface so you can SMS it from your phone for control
splitterwell, thanks for the tips all :)
merlyntips are greatly appreciated. :)

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 

IrcArchive