lkml.org 
[lkml]   [1997]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Forking (fwd)
> So why is clone() not meant to be used in applications?  If I want
> full control over how my program is parallelized across multiple processors,
> I'm going to want use clone(). If you claim that we shouldn't use clone()
> for "portability" reasons, that's a bunch of BS - if you want your
> application to all-out perform on SMP machines, you have to hand-tune
> it for each architecture, making portability pointless anyway.

Well, you can use it in applications. However, you need to add some assembly.
This is because you need to setup the return stack for the newly-created
thread, and you also have to fiddle with the registers in the way gcc
expects them.
If the C library provides an interface to clone, why not use it? If it
increases the application portability (removing the need for assembly,
allowing portability to other pthread implementations), why is this BS?
There are other reasons why you want threads than performance on an SMP
machine, like a simplification in the control flow or I/O completion.

Regards,
Martin

\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2011 Jasper Spaans