[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] sample code for evconnlistener and multi-thread
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] sample code for evconnlistener and multi-thread
- From: Zhuang Yuyao <mlistz@xxxxxxxxx>
- Date: Fri, 30 Oct 2009 23:34:43 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 30 Oct 2009 11:41:39 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=IDkgJ1eRRmzBs0tshaPDdPE6Y2lmp3LtELjQXqRRMl8=; b=xeKrZJHJwEJulZVkAK90BsBowXiRzUAQ0MzTRyRih6S8mt5EFPI4mZt1j+SxOX54H7 zf4nLQUl4q5HHHiaTsyi6+C5yjaAQUhtJGuWDCvspX0Y1z5x/eYe/JpttOwJdUmnIBnQ CxmqZkBQr614oPNS+SylLMaFWJ4TjMFCMqk0I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lBHyLeWJDUJZXHnzAdX68W72uZpzgojVlvLVdm0iKK5o5tsvNpB3oleIOEg0V7z91P lEmUaggDVH8kkz9gIX1MijrZp/CgwJpvjugKYoVYXbxd1GCRCY42SdCq1EAj2hds5xIt CMe0RpA6/42/XJpCpQDFGOniBoQ2PwX4mDdZk=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
I am wondering if anyone could show me some sample code of using
evconnlistener with multi-threaded connection handlers.
I've read the multi-thread code in memcached. in libevent 2.x, there
are some functions (ie. evthread_use_pthreads(),
evthread_make_base_notifiable(), event_queue_insert(),
event_queue_remove()) which look like the "official" implementation of
event notification cross threads. but after reading regress_pthread.c
(the only sample code bundled with libevent 2.x which contains
evthread_make_base_notifiable()), I still can not figure out how to
use evconnlistener() with multi-threaded connection handlers.
Any help will be appreciated, thanks very much.
Zhuang Yuyao
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.