• 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
Degree of multithreading in a server app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Degree of multithreading in a server app


  • Subject: Degree of multithreading in a server app
  • From: Hisaoki Nishida <email@hidden>
  • Date: Mon, 6 Jan 2003 23:23:52 -0500

Hi,

I was wondering if having 4 or more threads in a single application would do harm in any way.

In my sever model, I have a delegate object D, which, in a separate thread, creates a server object, S.
During the init stage of S, it forks another thread in which the listener object, L, is created and run.
L listens for incoming connections and notifies S (via NSNotification) when a new connection is detected. but S is then running its main infinite server loop which handles existing connections, and has no chance to receive the notification. Or does it? I'm not sure.

The solution I have in mind is to run the main server loop in another separate thread. That way S's main thread can handle notifications. This should work i think, but if there is a better solution, I'd be interested to know.

Thanks.

-Yuki
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: stringByTrimmingCharactersInSet: problem
  • Next by Date: Re: NSMutableDictionary Q's
  • Previous by thread: Re: stringByTrimmingCharactersInSet: problem
  • Next by thread: Re: Use of alloc in class (factory) methods
  • Index(es):
    • Date
    • Thread