You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a general design request. I think it would be nice to all the various watchers to fill out completions without adding them to a loop. I am working on a multithreaded system, where the main loop is behind lock. As such, I don't want threads to always lock due to calling loop.add. Instead it would be preferable to just create a completion. Later, the lock can be grabbed and loop.add called.
As such, it would be nice to have a version of the watcher functions that doesn't call loop.add. The simplest solution would be to change loop: *xev.Loop to a loop: ?*xev.Loop. If the loop is null, no add function is called. where be a modification here and in other equivalent functions:
That said, it may be nicer to fully split out the api and make two different calls. One that just fills out the completion and one that actually adds to the loop.
Thoughts?
The text was updated successfully, but these errors were encountered:
This is a general design request. I think it would be nice to all the various watchers to fill out completions without adding them to a loop. I am working on a multithreaded system, where the main loop is behind lock. As such, I don't want threads to always lock due to calling
loop.add
. Instead it would be preferable to just create a completion. Later, the lock can be grabbed andloop.add
called.As such, it would be nice to have a version of the watcher functions that doesn't call
loop.add
. The simplest solution would be to changeloop: *xev.Loop
to aloop: ?*xev.Loop
. If the loop is null, no add function is called. where be a modification here and in other equivalent functions:libxev/src/watcher/tcp.zig
Line 130 in b8d1d93
to something like:
That said, it may be nicer to fully split out the api and make two different calls. One that just fills out the completion and one that actually adds to the loop.
Thoughts?
The text was updated successfully, but these errors were encountered: