From: Ben Tilly Date: 2000-12-13T13:18:13+09:00 Subject: [ruby-talk:7130] Re: fork - or threading problems Kevin Smith wrote: > > >>So my suggestion would be that fork would take a parameter > >>indicating whether to bring all threads along, or none. Seems simple. [...] > >In that spirit, I suggest creating a trappable exception for > >attempting to fork while multiple threads are open without > >saying that you really wanted to do that. If they fork > >anyways, you at least know they were warned. Then for the > >benefit of threading offer an optional argument to Thread.new > >for a new thread which should actually be launched in a new > >process. > >It still seems like 80% of the time, the decision should be >made by the fork, and not by the thread. Perhaps it's just me. Um, that is what I am suggesting. With the default beahviour for fork to be that it should bomb out if you are threaded, and the easiest compatible behaviour be an API that makes it clear that while a lot is shared between the processes, the set of threads is not. Since what probably makes sense 80% or more of the time when you mix the two is not just a simple fork, don't call it fork. Cheers, Ben _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com