News for hackers. Stuff that matters.

_ko1

> Koichi: I do think so.

This is mistake. I said "I don't think so". 30% is not enough.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @06:11PM (#12457837)
More correctly, making a OS thread per a Ruby thread, and creating a Guild makes 1 Ruby thread.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] 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] on Thursday September 08, 2016 @06:06PM (#12457789)
Because of current limitation. We'll improve it.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @05:59PM (#12457732)
Yes.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @05:58PM (#12457727)
absolutely.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @05:57PM (#12457722)
> Thus, you would have to traverse the entire linked data structure to transfer ownership of every node. This is O(n) work.

Correct.

> Making things worse, you would have to make sure that the ownership transfer is atomic - no other part of the program should see the data structure in a “partially transferred” state.

Correct. Guild::Channel#transfer_ownership() does it.

Basically, share big linked data with multiple threads is difficult (simply we need to lock every access).

> Another example: Say you initially have a guild with three objects, Foo, Bar and Qux, where Foo and Bar point to Qux. If I transfer ownership of Foo, should Qux be transferred as well?

Foo -> Qux; Bar -> Qux

Yes, Qux also moved. Programmer can know by "exception" when accessing Qux via Bar after transfer.

This "realization" is the key of Guild. On threads, we can't realize that Qux is shared mutable.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @05:46PM (#12457635)
So we need to rewrite to support multi-guilds application.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] 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] 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] on Thursday September 08, 2016 @05:41PM (#12457598)
Similar to Erlang process, but more heavy weight (because it creates OS thread per Guild).
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @10:38AM (#12453376)
Yes.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @10:37AM (#12453372)
Quoted from slides: > GC/Heap > * Share it. Do stop the world parallel marking- and lazy concurrent sweeping. > * Synchronize only at page acquire timing. No any synchronization at creation time.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @10:22AM (#12453241)
It's magic of transferring membership. I omitted details on slides.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] on Thursday September 08, 2016 @02:50AM (#12450806)
Could you link to http://www.atdot.net/~ko1/activities/2016_rubykaigi.pdf ? current one is on temporary file space (will be removed soon).