News for hackers. Stuff that matters.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by zeckalpha on Thursday September 08, 2016 @02:29AM (#12450725)
How does this compare to the ongoing efforts to remove the GIL in Python? It looks like the Ruby GVL would stay, but be scoped to a Guild, rather than a Process?
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by the_mitsuhiko on Thursday September 08, 2016 @05:16AM (#12451436)
The proposal in the PDF looks like what I tried to implement many years ago in Python but I gave up in agony due to some stupid design decisions in Python (in particular non heap types and how type checks in the c level work).

Python's attempts to remove the GIL are not going anywhere really.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by sanxiyn on Thursday September 08, 2016 @10:39AM (#12453391)
What do you think of PyParallel's approach of "removing" GIL?

http://pyparallel.org/

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by claudiug on Thursday September 08, 2016 @12:02PM (#12454227)
maybe you should give them some inside :) Not the follow the same path of painful mistakes :)
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by viraptor on Thursday September 08, 2016 @04:19AM (#12451178)
Are there any ongoing efforts? There's pypy trying to use STM, but don't know of any other attempts - definitely not in cpython.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by zeckalpha on Saturday September 10, 2016 @01:59AM (#12467912)
Yes. There was an excellent talk at Pycon 2016, entitled the GILectomy: https://www.youtube.com/watch?v=P3AyI_u66Bw
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by artellectual on Thursday September 08, 2016 @02:39AM (#12450760)
Anyone correct me if I'm wrong here.

Seems like a guild is just a subprocess with its own resources. And you copy objects over as needed. And when the guild is done it will get garbage collected. Like other objects.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by the_mitsuhiko on Thursday September 08, 2016 @05:21AM (#12451461)
> Seems like a guild is just a subprocess with its own resources.

In an ideal world the guild is the interpreter state which would be very far from processes. How far down you can go there largely depends on what promises the API made to C extensions and other things in the past.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by Someone on Thursday September 08, 2016 @03:11AM (#12450887)
I think I would consider implementing it as 1:1 threading where every thread=guild runs its own set of green threads.

That likely would be faster than having OS threads in each guild that use PS locks to prevent running >1 of them concurrently.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by _ko1 on Thursday September 08, 2016 @05:43PM (#12457610)
CRuby/MRI supports C-extension which can use TLS (thread-local-storage). So that each Ruby threads runs on one OS thread.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by _ko1 on Thursday September 08, 2016 @05:45PM (#12457627)
Like sub-process, but share many things like bytecodes (ISeq in MRI context), class and module objects (and method tables) and so on. Also we can share immutable objects (deeply frozen objects) like threads.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by Roboprog on Thursday September 08, 2016 @12:07PM (#12454290)
The Guild concept feels much like a mix of actors and messaging from Erlang and Go. Not as restrictive as Erlang, but not as permissive as Go. (there was a nod to Elixir/Erlang in the slides)
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by _ko1 on Thursday September 08, 2016 @06:09PM (#12457817)
Yes.

Actually, I think Go is some kind of multi-thraeding (goroutine is only a useful mechanism on the "threads" and can't help to avoid multi-threads difficulties (but this design helps to reduce difficulties)).

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by Roboprog on Sunday September 18, 2016 @01:07PM (#12526070)
I would like to thank the team behind this proposal, very much, by the way. I have not tinkered with Ruby in a few years, but this looks like a major breakthrough.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by pmontra on Thursday September 08, 2016 @02:36AM (#12450748)
Yes, it becomes a guild global lock.