[#5218] Ruby Book Eng tl, ch1 question — Jon Babcock <jon@...>

13 messages 2000/10/02

[#5404] Object.foo, setters and so on — "Hal E. Fulton" <hal9000@...>

OK, here is what I think I know.

14 messages 2000/10/11

[#5425] Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Jon Babcock <jon@...>

18 messages 2000/10/11
[#5427] RE: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — OZAWA -Crouton- Sakuro <crouton@...> 2000/10/11

At Thu, 12 Oct 2000 03:49:46 +0900,

[#5429] Re: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Jon Babcock <jon@...> 2000/10/11

Thanks for the input.

[#5432] Re: Ruby Book Eng. tl, 9.8.11 -- seishitsu ? — Yasushi Shoji <yashi@...> 2000/10/11

At Thu, 12 Oct 2000 04:53:41 +0900,

[#5516] Re: Some newbye question — ts <decoux@...>

>>>>> "D" == Davide Marchignoli <marchign@di.unipi.it> writes:

80 messages 2000/10/13
[#5531] Re: Some newbye question — matz@... (Yukihiro Matsumoto) 2000/10/14

Hi,

[#5544] Re: Some newbye question — Davide Marchignoli <marchign@...> 2000/10/15

On Sat, 14 Oct 2000, Yukihiro Matsumoto wrote:

[#5576] Re: local variables (nested, in-block, parameters, etc.) — Dave Thomas <Dave@...> 2000/10/16

matz@zetabits.com (Yukihiro Matsumoto) writes:

[#5617] Re: local variables (nested, in-block, parameters, etc.) — "Brian F. Feldman" <green@...> 2000/10/16

Dave Thomas <Dave@thomases.com> wrote:

[#5705] Dynamic languages, SWOT ? — Hugh Sasse Staff Elec Eng <hgs@...>

There has been discussion on this list/group from time to time about

16 messages 2000/10/20
[#5712] Re: Dynamic languages, SWOT ? — Charles Hixson <charleshixsn@...> 2000/10/20

Hugh Sasse Staff Elec Eng wrote:

[#5882] [RFC] Towards a new synchronisation primitive — hipster <hipster@...4all.nl>

Hello fellow rubyists,

21 messages 2000/10/26

[ruby-talk:5913] Re: [RFC] Towards a new synchronisation primitive

From: hipster <hipster@...4all.nl>
Date: 2000-10-27 13:39:58 UTC
List: ruby-talk #5913
On Fri, 27 Oct 2000  20:57:03 +0900, Robert Feldt wrote:
[snip]
> Here's a proposal for a refactoring/design of Ruby's thread
> synchronization built on a "simple but sufficient" primitive (in order of 
> increasingly higher abstraction levels):
> 
> 1. rb_test_and_set(var)
> 	Atomic operation (ie. NO scheduling while it runs) for the
>         pseudocode:
> 
> 	int TestAndSet(int *x){
>            int temp = *x;
> 	   *x = 1;
> 	   return temp;
> 	end;
> 
>         The syntax in Ruby might be test_and_set(x) or something similar.
> 
> 	This is actually everything that is needed to implement all of
> 	the other common synch primitives.

We need a careful definition of the Ruby scheduler granularity here.
Otherwise even an expression like

	if test_and_set(bar) ...

can not be guaranteed to be atomic: reschedule between test_and_set
and if-evaluation. (or is this impossible?)

[..]
> 2. Implement the common synch primitives (Semaphore, Monitor,
> ConditionVariable, what-have-you) using test_and_set. They can even be
> written to handle the priority inversion problem since we have
> get_priotity and set_priority (alternatively this should/could be in the
> scheduler?). IMHO these basic building blocks should be part of the
> standard lib and we should encourage people to use them instead of using
> the test_and_set directly. To simplify things we can choose one of them
> and have it in the standard lib and then have the rest in an
> extension (see 4 below).

Hear hear... very nice

> 3. Implement synch/lock on the user-object level using the synch
> primitives in 2 above. See for example Masatoshi SEKI's MutexM at
> http://www.ruby-lang.org/en/raa-list.rhtml?name=MutexM

IIUC, this is the abstraction level where my proposal fits in.

If we can avoid new keywords altogether by using :synchronized
notation, that'd be a Good Thing.

> 4. Implement message queues and the rest of the common multi-threading
> helper classes in extension 'multithreading'.
> 
> My knowledge of the current implementation of Ruby threads is somewhat
> limited though, so I'm not sure how this would affect the deadlock
> detection currently available?

Same here. Got some catching up to do  :\

IMO a good proposal, thanks.

	Michel

In This Thread