From: Mauricio Fernandez Date: 2006-07-21T01:26:48+09:00 Subject: Re: [ANN] sandbox 0.0.11 -- taking the i out of eval On Thu, Jul 20, 2006 at 06:14:06PM +0200, Mauricio Fernandez wrote: > On Fri, Jul 21, 2006 at 12:51:12AM +0900, Joshua Haberman wrote: > > On Fri, Jul 21, 2006 at 12:30:14AM +0900, why the lucky stiff wrote: > This is exactly what was done in Sydney. I know know of any plan to bring > that to HEAD though (and there's no way it could get in ruby_1_8). > > YARV is doing (or will do, haven't checked for a while) native threads, but I > don't know if it's reentrant or just using a global interpreter lock like > Python. After a quick glance at the code, it seems to be using a global VM lock (GVL) -> model 2: >>>> YARV Thread Desgin model 1: Userlevel Thread Same as traditional ruby thread. model 2: Native Thread with Giant VM lock Using pthread (or Windows thread) and Ruby threads run concurrent. model 3: Native Thread with fine grain lock Using pthread and Ruby threads run concurrent or parallel. ------------------------------------------------------------------------ model 2: A thread has mutex (GVL: Global VM Lock) can run. When thread scheduling, running thread release GVL. If running thread try blocking operation, this thread must release GVL and another thread can continue this flow. After blocking operation, thread must check interrupt (YARV_CHECK_INTS). Every VM can run parallel. Ruby threads are scheduled by OS thread scheduler. ------------------------------------------------------------------------ model 3: Every threads run concurrent or parallel and to access shared object exclusive access control is needed. For example, to access String object or Array object, fine grain lock must be locked every time. */ <<<< I think I read somewhere that model 3 wouldn't be done before 2007. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby