News for hackers. Stuff that matters.
Re:Proposal of a new concurrency model for Ruby 3 [pdf] by parenthephobia on Thursday September 08, 2016 @06:37PM (#12458033)
> For example, how would you transfer ownership of a big linked data structure from one guild to another?

Slowly.

Objects well-suited to transfer would be shallow mutable structures with immutable data "underneath". Immutable data can be shared, so they'd be ignored by the transfer logic.

Another approach likely to be common would be not transferring objects at all, but sending proxy objects to other guilds which transparently marshal method invocations between those guilds and the object's home guild. For large mutable complexes which are intertwined with everything a guild does, that's probably a more manageable approach.

> 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

This is easy. You just run the transfer operation with the guild's mutex locked. No other guild can have a reference to a mutable object, and an immutable object doesn't need to be transferred.

> In Ruby, what exactly should happen here? Have these guys really thought about the possibilities?

It seems obvious that every linked mutable object is invalidated, so Qux will be transferred.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by catnaroek on Thursday September 08, 2016 @07:33PM (#12458404)
> Objects well-suited to transfer would be shallow mutable structures with immutable data "underneath". Immutable data can be shared, so they'd be ignored by the transfer logic.

How often are data structures designed like this in Ruby?

> Another approach likely to be common would be not transferring objects at all, but sending proxy objects to other guilds which transparently marshal method invocations between those guilds and the object's home guild.

What if said “home guild” ends up overburdened with requests coming from all over the place?

> This is easy. You just run the transfer operation with the guild's mutex locked.

You mean both the sender and the receiver's mutexes? I'm worried about the receiver being able to observe partial transfers.

Re:Proposal of a new concurrency model for Ruby 3 [pdf] by eregon on Thursday September 15, 2016 @08:05AM (#12505353)
The object graph would only be handed to the receiver once it's fully transferred I would imagine.