[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] HTTP and thread safety
- To: Libevent MailingList <libevent-users@xxxxxxxx>
- Subject: [Libevent-users] HTTP and thread safety
- From: Marco <marco.tijuana@xxxxxxxxx>
- Date: Mon, 31 Jan 2011 09:42:26 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 31 Jan 2011 12:49:20 -0500
- 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=ocG/gN1Q9dAfNCnAaijo4BPOuFrJGBapiBR8lNn0JOg=; b=sm7618rvbwHN9zFbj1DqTV2fGtws6q0wjUn24RM99JTWTM3r9ZCzgU4lFq72LI8AUy avwfHs1lmT33g0ygRdzRcEM9b6cVbELSogt4eWuSD5mJk+g97U7PVob8b2JEdexTbEk1 s6TwrnHDHxA5SHtSy0PyZGtHsijGEbGjChS74=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Gpx0tZTdDMXCeaxhhVh5xRz+NwnZKTEelbleZDasC9AyVkDeg/ri73UgsSLLJga8dG T/bRjb2829DidQe9MlnzJwEWdrYbUT9iS4k3QydLJzF5wRSk/uOy/ialDBd/SzujwarA CJfMqBxcjv5H0PLfKmtW9Smc4HARyud5yS1iU=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi everyone, simple question..
2 threads, T1 is in the event loop, T2 does some other things.
Assume that I have a safe way of communicating between T1 and T2.
I'm planning to use T2 to create http requests objects and then give them to T1 to actually perform the request, i.e.:
T2 calls
- evhttp_connection_base_new
- evhttp_connection_set_timeout
- evhttp_connection_set_retries
- evhttp_connection_set_closecb
- evhttp_request_new
Then T2 passes the evhttp_connection and evhttp_request to T1, who calls evhttp_make_request.
(again, assume this message passing is implemeted safely)
Is this thread safe?
Or does any of the functions invoked by T2 modify the event base (owned by T1)?
Marco