[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] event base: multi-thread producers, single thread consumer?
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] event base: multi-thread producers, single thread consumer?
- From: Scott Dorr <j.scott.dorr@xxxxxxxxx>
- Date: Thu, 21 Apr 2011 15:29:52 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Thu, 21 Apr 2011 18:30:00 -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=ukoBf8xabB1KCovS7yyImi9rt8lYbtTKShtsgbsLacA=; b=UZfaPu8GChV9c5JHbK4hGfAGGUTDds9zmsKoUTUMwPRimBRD2PUggJGA5yyxZzYGvT QDP6TPB0HSi5QQ9V1wP0KtXaG+8EtcAqf2YBRQlhhldMay2ENNDSTTgef+2kktzX1wF3 nTKaFNUWaKqW11rVCN3o7y17WzuIcuIphZe0Q=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Gv/omZF/pxYrpaoKWSGhmz7Okqjy7xAxfErisytQ08fb+pKQPS3VInDM2EqYXBSuCv FHTiMVwivV7OtN7rrFWIlz+9eex7cjWs1G8a+/r46X4JrNYKoOmYC6QQbUvXpy6rChIN 6oopvAlSR4/m66hg4Kgb7pRvp0GS9H2yYD0Vg=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
I've got a server with multiple threads, each with their own event base. Works wonderfully. I have a new situation that would be solved quite easily if I could have all threads (but one) push events onto the event base for the final thread. That final thread will process events as they come up.
Reading through some of the additional libevent documentation, I'm wondering if I'm going to need to engage the various locking bits (evthread_set_id_callback, evthread_set_lock_callbacks, etc) to preserve the sanctity of that one event base?
So far, I've been able to avoid any kind of locking in this server and would be quite reluctant to add any at this point.
Thoughts? Thanks!
- scott