mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
EventMgr: Remove queue_flare, use GetNextTimeout() instead
It can be visible overhead to call write() on the underlying pipe of the EventMgr's flare whenever the first event is enqueued during an IO loop iteration. Particularly in scenarios where there's about 1 event per packet for long lived connections and script-side event processing is fast. Given the event manager is drained anyhow at the end of the main loop, this shouldn't be needed. In fact, the EventMgr.Process() method is basically a stub. The one reason it is needed is when more events are enqueued during a drain. That, however, can be dealt with by implementing GetNextTimeout() to return 0.0 when there's more events queued. This way the main-loop's poll timeout is 0.0 and it'll continue immediately. This also allows to removes some extra code and drop the recently introduced InitPostFork() addition: Without a pipe, there's no need to recreate it.
This commit is contained in:
parent
01e305edd8
commit
46acd9168e
3 changed files with 6 additions and 23 deletions
|
@ -506,8 +506,6 @@ SetupResult setup(int argc, char** argv, Options* zopts) {
|
|||
// If we get here, we're a supervised node that just returned
|
||||
// from CreateStem() after being forked from the stem.
|
||||
Supervisor::ThisNode()->Init(&options);
|
||||
|
||||
event_mgr.InitPostFork();
|
||||
}
|
||||
|
||||
script_coverage_mgr.ReadStats();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue