[Libevent-users] multiple read events triggered
Matt Pearson
404emailnotfound at gmail.com
Tue Oct 2 15:01:57 EDT 2007
On 10/1/07, Rick R <rick.richardson at gmail.com> wrote:
> In the data_reader callback, I push the socket info into a work queue that
> is handled by a thread pool. This is where things get wierd, I can read read
> from the socket from the other thread just fine, but libevent often fires an
> additional 30-110 events, it's like it keeps firing the event until I read
> the data, is this the correct behavior?
This is the correct behavior. If you don't want to keep receiving
read events on that file descriptor, you'll have to call event_del()
or not use the EV_PERSIST flag. Then you'll have to figure out a way
for the worker thread to tell the main thread to re-add the event.
More information about the Libevent-users
mailing list