[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Threads vs Processes?
On Sun, Nov 19, 2000 at 09:30:40PM +0530, Arsalan Zaidi wrote:
> My Q is this. One obvious way to ensure that my program doesn't block and
> wait at I/O (short of using Async I/O) is to fork off a seperate process or
> spawn a thread to do the reads/writes.
Non blocking read i.e. select/poll loop is the simplest and the easiest.
But it could block the whole process on page faults and such OS events.
> What would be more efficient, across platforms (*nix and otherwise), using
> threads or sforked processes?
sfork is not portable.
> Basically, any advice on what I should use for max portability and max
If you're shooting for performance, use pthreads and hope that each
platform will map it to the most optimal thing.