From: Robert Klemme Date: 2003-06-04T17:35:27+09:00 Subject: Re: thread-unsafe stuff: could you summarize? "Tom Felker" schrieb im Newsbeitrag news:1054670835.2342.74.camel@tom... > On Mon, 2003-06-02 at 03:24, Robert Klemme wrote: > > > > First, accesses to @deferRunning should be done synchronized. But: Why do > > you introduce @deferRunning when you have already a Mutex? You can do > > try_lock and locked? on a Mutex thread safe but without blocking the > > current thread. > > Looking back, I can't remember why I even have that. If you remove all > reference to @deferRunning, it'll work the way I want. :-) > Well, it did work, but you're right, @deferRunning is pointless. Code > always looks different when you look at it a week later. :-) :-) > I guess my question is, is it OK to pass blocks between threads like > this? Yes. After all, a block is an object, isn't it? And it does not contain runtime information like a continuation does. So there's never danger to get threads mixed up. I'm not sure about continuations. Could be, that you can't pass them around. > Also, am I doing the right thing with making it both a module and > a class? The class is superfluous. It's not needed. > 38% of statistics are made up on the spot. Wrong: It's 53.5%. No, wait - it's 23.3% .... :-) Cheers robert