Adam Haberlach writes:
> Typically (on a well-written OS, at least), the spawning of a thread
> is much cheaper then the creation of a new process (via fork()).
This would be well worth testing on some representative sample
Within the past year and a half at one of my gigs some coworkers did
tests on various platforms (Irix, Solaris, a few variations of Linux
and *BSDs) and concluded that in fact the threads implementations were
often *slower* than using processes for moving and distributing the
sorts of data that they were playing with.
With copy-on-write and interprocess pipes that are roughly equivalent
to memcpy() speeds it was determined for that application that the
best way to split up tasks was fork()ing and dup().
As always, your mileage will vary, but the one thing that consistently
amazes me on the Un*x like operating systems is that usually the
programmatically simplest way to implement something has been
optimized all to heck.
A lesson that comes hard to those of us who grew up on MS systems.
In response to
pgsql-hackers by date
|Next:||From: Jan Wieck||Date: 2000-12-04 23:01:46|
|Subject: Re: 8192 BLCKSZ ?]|
|Previous:||From: Tom Lane||Date: 2000-12-04 21:51:52|
|Subject: Re: Wrong FOR UPDATE lock type |