Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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

by cdarke (Prior)
on Jan 26, 2009 at 10:47 UTC ( #738904=note: print w/replies, xml ) Need Help??

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

It is a "feature" of inotify on Linux that if you do not read events fast enough, you will miss them (certain Windows interfaces suffer from the same problem).

I suggest that you process the events in a different thread. You might also want to checkout Linux::Inotify2.
  • Comment on Re: How to wait for events, and not lose any, while processing them ?

Replies are listed 'Best First'.
Re^2: How to wait for events, and not lose any, while processing them ?
by Eyck (Priest) on Jan 26, 2009 at 10:59 UTC
    The code above starts with use Linux::Inotify2, the problem is with processing the events, I don't quite get it how putting up another threads solves the issue, you still need to pause to push the data to another thread.

      Frequently, event handlers are done in a callback style with very little in the way of resources. (For example, in interrupt handlers, the interrupts may be disabled during the handler body, preventing other interrupt-driven events from being noticed.) So typically, you store the request with as little processing as possible, to allow the event system to get back to its job of collecting events.

      Then your other thread can pull events off the queue and process them. That way, if you have a rapid flurry of events, they'll stack up in the queue. If you tried handling them in the event handler, the rapid flurry of events could be lost.

      Please note that this is a "hand wavy" explanation because there are many similar systems in which the implementation details are different, and I don't know anything about the Linux::Inotify2 package, so I can't comment on any specifics.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://738904]
[Discipulus]: no makita sorry. i see in the synopsis of the module: "WARNING: Only limited real-life experience" might be better compose a SOPW with some code example and data
[Discipulus]: ..or inspect the source code of the module
[makita]: I am doing this:
[makita]: my $sig = $wss->signature( schema => $wsdl, token => $token, sign_types=>'wsa: Action','wsa:To', 'wsu:Timestamp', 'wsa:MessageID',' SOAP-ENV:Body', signer=>DSIG_RSA_S HA1, public_key => $cert,
[Corion]: Oof, I haven't done much with signing SOAP requests. markov is usually somebody good to ask via mail ;)
[makita]: I need to create a SOAP call where are signed more types not only the body
[makita]: I am inspecting it second day :)
[makita]: Thanks
[Discipulus]: better to ask a full SOPW
erix self-flagellates with the cluebat

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-03-23 08:45 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.