From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <9a85b2919100cf268e471b3b04c3c9cb@gmx.de> References: <20100109053313.GA19304@machine> <9a85b2919100cf268e471b3b04c3c9cb@gmx.de> Date: Sat, 9 Jan 2010 16:55:24 +1100 Message-ID: <775b8d191001082155h141b0ad3i2cc051e8c2d6dfe@mail.gmail.com> From: Bruce Ellis To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] libthread API Topicbox-Message-UUID: bbd3610e-ead5-11e9-9d60-3106f5b1d025 ahh my wise, cold, east german friend. good answer and fluffy agrees. brucee On 1/9/10, cinap_lenrek@gmx.de wrote: > > Thanks, now I understand. The main question was why threadcreate asks > > for function pointer and can't just leave me in my function like rfork. > > So it is because we should move local variables out of scope as they > > are no more valid cause we have a new completely clear stack. > yes. > > > But when it is better to use rfork with shared memory and when > > libthread? > depends. but in the majority of cases you want to use libthread because > it also gives you synchronization primitives like channels and has > co-routines called threads wich run cooperatively in a real system > proc. > > but nobody forces you to use libthread. you can just use system primitives > like rendezvous, qlocks, pipes and shared memory with rfork. > > -- > cinap > > >