[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Threads vs Processes?



Hi.

Working on designing a deamon which has to perform a lot of disk
reads/writes and I hope that it will eventually compile and run on a variety
of platforms...

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.

What would be more efficient, across platforms (*nix and otherwise), using
threads or sforked processes?

Is using a thread lib a good idea? Using it on a kernel that switches stuff
around on a per process probably isn't going to be as good as using
processes straight off, but how bad is it?

IIRC (but then again I may not) Linux doesn't schedule at the thread level
while Solaris does. I think Solaris's processes are pretty expensive too...

Basically, any advice on what I should use for max portability and max
performance?


--Arsalan.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12 (www.geekcode.com)
GAT/GCS/GE/GTW d+(-) s: a-- C++++$ UL+++$ P++$ L++++$ E+ W++ N++@ o? K? w++
!O M-- V? PS@ PE Y+ PGP t+@ 5? X R? tv+ b++(+++) DI+ D+ G>G++ e++ h! !r y?
------END GEEK CODE BLOCK------