[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] event_active bug?
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] event_active bug?
- From: Michał Król <mharnen@xxxxxxxxx>
- Date: Fri, 29 Apr 2011 11:43:04 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 29 Apr 2011 05:43:14 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=fGAC99C7anqAqa4JGf8Ddzlu50twe6ycjh4E/9SM0rY=; b=w8a7osjfKIMTrYe4kQ1JA8WVi43qRby/bBggjTxaR1GbmD9MjXtB+sD2OmiLZpQT3j 7sp3qB9QcKhYJbLIxQ0ZpuwAl6Z8xh2jBK8vt4CVxyvi5IPTL7jIWaoStdJ03vkyVBor QKMCL0yGyaGAlXWC2/1V56lxiku3QNbIVuUyM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ejbXwKuzbv0sn/J8P4FD5vJYkhTjjvpjaoUr/oHjgHQg3DuPO8JkPJREZR/NA2OskH u/1lytbfw9FczTIyg1OfpC4izQeBhbcaigRx66wzSzvEfBQvoHPZq2xAoteoL/67dlt2 f6o1+LwTrjA1HpYP91YnAA98EHyTQ/yYk5nBc=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
I had some problems using event_active() function, and as I'm not sure weather it's a bug or not I've decided to write about it.
I'm using two event bases, sender_base and feeder_base. sender_base runs as a main program loop using event_dispatch(). If there is nothing to send it calls event_base_loop() on feeder_base which fills the buffer (with events reading from files which(events) are all the time active).
So in feeder_base there are many all the time pending events and there are invoked one by one when event_base_loop() is called.
It worked perfectly fine unless I've decided to add to the feeder_base event which invokes itself by event_active and not by file descriptor + EV_READ. This event was filling the buffer and then rescheduling itself calling event_active(). I've expected that after calling event_active event will be just scheduled as pending and invoked during next call of event_base_loop(). But from this time it was invoking itself infinitely within one loop of feeder_base. I was able to override this problem by opening random file (like /dev/zero) and invoking this event based on EV_READ and not by event_active. Anyway I'm just not sure if event_active is supposed to work like this or it's kind of a bug, so I've decided to write about it.
I know my architecture is a bit messy, but I hope my description is clear enough.
Thanks for any help
Harnen