• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kqueue, multithreading and architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >kqueue, multithreading and architecture (From: Marco Bambini <email@hidden>)

  • Prev by Date: kqueue, multithreading and architecture
  • Next by Date: Determining if the system firewall is running
  • Previous by thread: kqueue, multithreading and architecture
  • Next by thread: Re: kqueue, multithreading and architecture
  • Index(es):
    • Date
    • Thread