Re: kqueue, multithreading and architecture
Re: kqueue, multithreading and architecture
- Subject: Re: kqueue, multithreading and architecture
- From: Scott Ribe <email@hidden>
- Date: Fri, 09 Nov 2007 10:18:41 -0600
- Thread-topic: kqueue, multithreading and architecture
> My question is if that could be a good solution and if I can safely
> add an event to a kqueue queue owned and created by another thread.
Kqueue is designed for use in multi-threaded situations, so yes that is
fine. However there are also other ways to pass data between threads. You
really only need a kqueue for your listening thread in order to pick up new
socket connections. When it comes time to pass the sockets off to worker
threads (or worker threads to pass results, or any other thing that involves
passing around your own data rather than waiting on system-level socket or
file events), you can look at pthread, Mach, MPQueue, NSThread, boost
threads and so on--depending on what you're comfortable with and what fits
best with the rest of your design and implementation.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden