Hacker Newsnew | past | comments | ask | show | jobs | submit | _ko1's commentslogin

> Koichi: I do think so.

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


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)).


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.


Because of current limitation. We'll improve it.


Yes.


absolutely.


> 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.


Thanks. This clarifies a lot of things.


So we need to rewrite to support multi-guilds application.


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.


CRuby/MRI supports C-extension which can use TLS (thread-local-storage). So that each Ruby threads runs on one OS thread.


Similar to Erlang process, but more heavy weight (because it creates OS thread per Guild).


More correctly, making a OS thread per a Ruby thread, and creating a Guild makes 1 Ruby thread.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: