[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Cross-event base interactions
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] Cross-event base interactions
- From: Ralph Castain <rhc@xxxxxxxxxxxx>
- Date: Tue, 20 Nov 2012 14:55:40 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 20 Nov 2012 17:55:47 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version:x-mailer; bh=YGzJU4fMbuPBxR7sImd7bItfIeGvrUGq5Oh4JB/Ej0o=; b=MC7K9vTWT2AABs4b7pgld7uOuzgN7xhqeTghe3t/6q7LBng0ghQAvVyXAcSbIVXffK PUmihxxTb1tYNE4AcEn3dfbp95vCz2rpq0J28pesPkmjfPMjDKVbe0IwjylSWDygdMNz vL4imvGidqilpBNLzlcq+LRRvfNCzFX+xfdcjXetJGkC+4g0YGPI6hJZGWiKvh+zDlW4 aZRVSqngpkEoz4TLdiPfQvawN96iV7cL5dBrKetamTW8Jy2E/dUjwyltyWIs+U07x6Lw A3xIPXfz9r0AmZ74bH5hNgihqSItg7/bqM7qs2Xj6sZblVv+N2a9vtE3mngciPqE4xuu yLiw==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi folks
We have a case where we are running two parallel threads, each looping on their own event base (we have the libevent thread support enabled). Even though the two bases are running in separate threads, however, we see an impact on response time - i.e., if we run only one thread, events in that event base are serviced faster than when the other thread is in operation, even if no events in that thread are active.
Just to be clear, the two cases are:
Case 1
A single event base is created, and a single event loop is running. Two file descriptors are being monitored by separate events - when one file descriptor has data, that event is "activated" to handle the data. Data is only arriving at one file descriptor, so the other one is "quiet".
Case 2
Two event bases are created, each being looped by an independent thread. Each base is monitoring a different file descriptor. Only one file descriptor (for the same base as above) is receiving data - the other base/thread is blocked in select. We see a measurable increase in the time it takes for the "active" event to be serviced when compared to Case 1 - the difference is roughly 20%.
Is this cross-interaction expected? Any suggestions on how we might better separate the two channels?
Thanks
Ralph
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.