From: matz@... (Yukihiro Matsumoto) Date: 2002-04-22T17:22:47+09:00 Subject: Re: Threads creating threads creating threads... Hi, In message "Re: Threads creating threads creating threads..." on 02/04/22, Jean-Hugues ROBERT writes: |> I'm very interested in how it works. Could you |>show me the source, please? | |Unfortunately I don't have the source code anymore, it belongs to one of my |previous companies. Be prepared for a rather intense debugging session |however, because when implementing that stack allocator you can not rely on |the normal flow of control, you have to use a global state automata to know |what to do next whenever you return from a setjmp()... I'm well prepared though debugging Ruby's user thread code. ;-) The current interpreter eats stack a lot, so that fixed sized stack may not be acceptable. The situation might change for re-implemented Ruby 2.0 interpreter. |I'll send further infos, if needed, privately (versus to mailing list) |because I guess this is about very technical C stuff and not about Ruby so |much ;-) [ruby-talk:38791] helped me a lot. I still want to hear more, if you please. Others on the list would want to hear from you too. Does allocated jmp_buf with fixed sized stack reside over the main stack? Like this? --stack bottom-- | | grows this way V --stack top-- the gap --thread stack1-- fixed size --stack top-- jump_buf points here --thread stack2-- fixed size --stack top-- jump_buf points here --thread stack3-- fixed size --stack top-- jump_buf points here Right? matz.