[Gllug] Max number of pthreads in Linux ?

Daniel P. Berrange dan at berrange.com
Sat Mar 29 14:54:56 UTC 2008


On Sat, Mar 29, 2008 at 02:39:41PM +0100, salsaman at xs4all.nl wrote:
> On Sat, March 29, 2008 14:32, Progga wrote:
> > On Sat, Mar 29, 2008 at 12:44:08PM +0000, Nix wrote:
> >>
> >> Threads strike me as one of those ideas that's really great where
> >> necessary (e.g. when sharing is unavoidable, e.g. in kernel space) and
> >> otherwise really silly.
> >
> > But don't they save memory space even on Unices?
> >
> > --
> > Gllug mailing list  -  Gllug at gllug.org.uk
> > http://lists.gllug.org.uk/mailman/listinfo/gllug
> >
> 
> I'm pretty sure they do - plus startup time is much quicker, shared memory
> is done much easier, communication is simpler, locking can be done through
> mutexes, etc.
> 
> However, in the case I was looking at for a potential client, I can so far
> see no reason to use threads as opposed to a single process. I think the
> client is under the impression that running with 10,000 threads will make
> the program run 10,000 times faster...

They're probably coming from a Solaris background where forking a process
has an order of magnitude more overhead than forking a thread. In Linux
world forking a process is already exceedingly low overhead so there is
little difference as comparing to forking a thread, unless the process
has a huge number of memory maps which need cloning.

Dan.
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080329/2ace54a5/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list