Re: threads or processes?
Re: threads or processes?
- Subject: Re: threads or processes?
- From: John Stiles <email@hidden>
- Date: Sat, 28 Jan 2006 08:25:09 -0800
Andrew Farmer wrote:
On 28 Jan 06, at 00:55, Andrew Bush wrote:
Im looking at writing an app that will be required to have a number
of connections to a remote server going at once, up to 100-200.
Im wondering whether the best design in mac os x would be to use
multiple processes...spawn one process for each server and let them
do their thing...or whether I would get better performance by
handling with them all in one process.
Use a single process. Cocoa will let you add a socket to a process's
runloop, so you don't even have to do anything fancy to wait on input.
If that doesn't work, then go with threads. Creating a process for
each connection is (1) total overkill and (2) will hit the standard
per-user ulimit of 100 processes.
In OS X? Are you sure?
MafiaHQ:~ jstiles$ ulimit
unlimited
At any rate, I agree that one process per connection is expensive.
However, it's what Apache used to do IIRC (and maybe still does, I don't
know), so it can't be /that/ awful.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden