[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Re: pthreads undren



Valery Kotchiev wrote:
> 
> On Thu, 6 Jan 2000, Simon Lodal wrote:
> 
> > Mit program starter. Der er 1 thread; 1 process. Når jeg spawner en
> > thread første gang, er der pludselig 3 threads med pid's på række. Jeg
> > er godt klar over at threads er processer (med egen pid), men hvorfor
> > er der 3?
> 
> Det har jeg også opdaget når jeg programmerede med threads. Jeg tror det
> har noget at gøre med den thread-emulering, da det er kendt at unix ikke
> har native support for threading.

Det er vist ligesom hvorfra man ser det, men det er rigtigt at
grundenheden i de fleste Unix kerner i en process, hvor tråde så er
lavet inde i denne, enten i kernen eller i et bibliotek. I Linux må
dette dog siges at være lavet meget smukt. En tråd er bare en process
der deler fildescriptorer og dataområde med forfaderen, det hele
oprettes vha. clone(2), men med forskellige flag afhængig af, om man vil
have en tråd eller om man vil have en alm. fork(2).

Og tider for oprettelse og processkifte af en tråd sparker stadigvæk's
Solaris og NT's numse (NB: har ikke selv afprøvet, det er 2. håndsinfo)

Mvh Morten


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *