[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Bufferevent threadsafe opt questions.
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] Bufferevent threadsafe opt questions.
- From: Jj Jack <jjjack94@xxxxxxxxx>
- Date: Tue, 9 Feb 2010 00:39:37 -0800 (PST)
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 09 Feb 2010 03:39:43 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1265704777; bh=G3b4cbc1As7IpxuglnwV4ETVvoQlsKrafRwaL2wXykQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=0CMYdxDQccGkhbnPDYHrDCfJInFiclZ50c9lTVWBEx4AT3trAwOiBUHkEIVyUdYEEJgAOukNn2gTMeuZgXTFU6EkRuoyytYMHLmp2hD6kXQp0EVwXcVtRIvNNP8fcIngVaV2TPv5zT/LRR6doM8BnsECXupqa8jjNMsQVP+Ux7E=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=EkTbNBNOZuVZEa2JNjLV+7FDDIUd4XIjvdnX2Pviuu74bnX+Ek0k+RPgiYW0ErDyAo38y3Tu9bNV23DF5Z7T4qItWFAgoEq9XnWdBYePwOqvWdgooJO/GTVEq7Yf9elrukuQNRdg1NUzAIgAWcyUFOVEByiibHQZ505Zag5e/GM=;
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hello again,
I have some questions related to BEV_OPT_THREADSAFE, specifically.. when exactly is the option's use required?
If I have an application that has two threads, one that writes to the output buffer only, and another that reads from the input buffer only, with at max one thread at a time reading from those two buffers (i.e, 2 threads maximum at a time, but always on opposite buffers), do I still need locks?
What if I was to read some data, disable the bufferevent, and then re-enable it later from another thread that would add some data to it (or something), (i.e, maximum one thread at a time here, but multiple threads over time), is that safe?
Essentially, my question is, what is safe, what isn't, when should they be used? I'm hoping my questions will help other people interested in the same thing too!
Thank you!
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.