From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA02309; Sat, 12 Oct 2002 18:33:39 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA03135 for ; Sat, 12 Oct 2002 18:33:38 +0200 (MET DST) Received: from mail1.tpgi.com.au (mail.tpgi.com.au [203.12.160.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9CGXa502117 for ; Sat, 12 Oct 2002 18:33:36 +0200 (MET DST) Received: from ozemail.com.au (syd-ts18-2600-076.tpgi.com.au [203.58.21.76]) (authenticated (0 bits)) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id g9CGXXg21237 for ; Sun, 13 Oct 2002 02:33:33 +1000 Message-ID: <3DA84EE0.806@ozemail.com.au> Date: Sun, 13 Oct 2002 02:33:36 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] gc question: thread stacks, fibers, etc. References: <4.3.2.7.2.20021004000748.030bd2c0@mail.d6.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Chris Hecker wrote: > > Fibers/Coroutines/Cooperative-Threads > In C, you implement them by mallocing a stack and with a little snippet > of asm, or mucking with the jmpbuf fields. They're pretty trivial to > get working fairly robustly .. and fairly useless in most demanding applications due to the impossibility of dynamically extending/shrinking the stack. If that isn't a problem .. you might as well just use real threads .. Felix solves this problem by using heap allocated stack frames .. there is a cost in that many procedure calls must be done indirectly via a driver routine which maintains the top of stack pointer for each thread. It also preserves high efficiency by disallowing blocking I/O (yields) in functional code, which use the machine stack as usual. BTW: I consider the technique a case of continuations, but it is probably more correct to consider it as a system of resumptions. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners