Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")

by isync (Hermit)
on Oct 17, 2010 at 01:12 UTC ( #865753=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")
in thread Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")

Thanks for your opinionated post! So far, I've only taken a few steps into the event-framework-world. After reading a bit of POE docs I soon tripped about more and more comments which said "avoid POE". AE promised to master them all. And when I started to dive into AE, exactly what you've described began to happen: I found myself writing a while loop again AND event triggers and listeners etc.

An old-fashioned serial loop structure plus some threading might not have the bells and whistles of events, but your post convinced me to try the "pragmatic path" first. Keep it simple stupid, once again. I think I need to re-think my design...


Comment on Re^4: Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")
Re^5: Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")
by james2vegas (Chaplain) on Oct 17, 2010 at 01:23 UTC
    Yes, from your description you seem to be trying to shoehorn a sequential program into an event loop. AnyEvent (or POE, or IO::Async, or whatever) is not a hammer for every nail, it is not always appropriate, but I'm not certain I'd recommend threads either, perhaps a combination of fork and some form of IPC (using one of the fine modules on CPAN, such as Parallel::ForkManager) might be better. It would definitely make good use of your pre-emptive, multi-tasking operating system.
Re^5: Doing an Input->process->Output cycle with AnyEvent? (was: error: "recursive blocking wait detected")
by BrowserUk (Pope) on Oct 17, 2010 at 02:02 UTC
    I think I need to re-think my design...

    If you are able to post a description of the application, I'd be more than willing to offer suggestions on how you might tackle it with threads.

    Maybe we could even get one of the events guys to knock up a solution also and then compare results.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I think I will now revert to doing more actual development on the system after all the input, to find out where the real challenges lie.
      ...before I begin to post gory details which might turn out as being sideshows... ;)

      Thanks everyone!
        ..before I begin to post gory details which might turn out as being sideshows..

        Fair enough.

        I originally started out writing a short, pithy reply here, but it turned into another long-winded "opinion piece". So, in respect of your wish for no more sideshows, I'm posting it as a meditation instead.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://865753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-07-29 00:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls