[Libevent-users] semaphore event

arthur mail2arthur at gmail.com
Tue Oct 30 09:47:16 EDT 2007


Hi All,

I am working on simple socket proxy/filter. To overcome the limitation of
fd's per process, the main creates a semaphore, and forks after create
listen socket, then the one which gets semaphore will accept. When the
active process reaches this max connections, it unlocks the semaphore and
stops accepting so anther process will start to work.

My question is regarding reactive the first process, for now it checks
(can't wait since we need keep event_dispatch running) the semaphore
whenever closing a connection but I feel the code a little ugly (keep
checking in an event driven app). Can I get a libevent event for semaphore
notification, like the how the signal works.

Thanks in advance.

Cheers,

Arthur



More information about the Libevent-users mailing list