• 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
kqueue, multithreading and architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kqueue, multithreading and architecture


  • Subject: kqueue, multithreading and architecture
  • From: Marco Bambini <email@hidden>
  • Date: Fri, 9 Nov 2007 10:35:56 +0100

Hi guys,

I am writing a network server that should also be both high performance and scalable, the architecture I decided to adopt is a threaded pool with a kqueue queue for each thread.
Each kqueue will receive read notifications for the various connected sockets and then it will be responsible to do the required job.


The idea was to have Thread1 blocked in a "listen" loop and each time a new socket connects, Thread1 pass that socket to the kqueue in Thread2.
Thread2 is simply blocked waiting for socket events (or busy doing other operations).


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.
Please note that I simplified the solution, because in my case Thread1 could also decided to pass the newly connected socket to Thread3 or Thread4.


Please note that I don't want to use the listing socket inside the kqueue owned by the working threads because much of the time they will be busy trying to build a proper reply for an already connected socket.
Any suggestion on how to improve that architecture is more than welcomed.


Thanks a lot,
Marco Bambini
_______________________________________________
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


  • Follow-Ups:
    • Re: kqueue, multithreading and architecture
      • From: Chris Newman <email@hidden>
    • Re: kqueue, multithreading and architecture
      • From: Scott Ribe <email@hidden>
  • Prev by Date: Changing Account Mid-Session with HTTP Authentication
  • Next by Date: Re: kqueue, multithreading and architecture
  • Previous by thread: Changing Account Mid-Session with HTTP Authentication
  • Next by thread: Re: kqueue, multithreading and architecture
  • Index(es):
    • Date
    • Thread