Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: How to wait for events, and not lose any, while processing them ?

by Eyck (Priest)
on Jan 27, 2009 at 08:42 UTC ( #739128=note: print w/ replies, xml ) Need Help??


in reply to Re: How to wait for events, and not lose any, while processing them ?
in thread How to wait for events, and not lose any, while processing them ?

This is great, textbook example of handling events with additional thread, thanks.

The problem however, is that the 'processEvents' CAUSES new events to be generated, thus, without echo-filter

while ($keepOnWatching) { if (ThisIsNotMyOwnEcho()) {# echo-filter processEvents(); } };

this solution changes 1-cpu burning into multiple-cores burning program.


Comment on Re^2: How to wait for events, and not lose any, while processing them ?
Download Code
Replies are listed 'Best First'.
Re^3: How to wait for events, and not lose any, while processing them ?
by BrowserUk (Pope) on Jan 27, 2009 at 09:32 UTC

    If you only describe half the problem, (less--how do you distinguish an "echo" from the "real thing"?), you only get half a solution. That said, the architecture stays the same.

    You either filter events before you queue them, or after you dequeue them, whichever is more convenient and timely.


    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2015-07-28 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (259 votes), past polls