It's true, that example isn't a real word example. This was simply me trying 
different things to figure out where it broke, and then being surprised when it 
broke even if I didn't use the argument. The point is that right now `isolate` 
is so strict it's not useful at all. Since you can't pass in data to work with 
I can't think of a scenario where what you put inside `isolate` couldn't just 
have been moved to the receiving thread. Of course we can use anything that 
doesn't have refs, but since refs are considered safe anywhere else in the 
language they are pretty much everywhere.

I'm not saying that alias analysis is easy, I'm just saying that without it 
`isolate` isn't really all that useful. Indeed having a rule like "every local 
variable involved in `isolate` must not be used afterwards" would vastly 
improve the system. But you still have to know that the local variable can't be 
an alias and that it can't alias anything which is used afterwards. And then it 
seems like we've come full circle. The rule would really be "could this entire 
tree be garbage collected right now, if it weren't for the single reference 
we're trying to isolate". If that is the case then it should be safe to pass 
that single reference on to another thread, because without it the tree would 
be collected.

I could whip up a realistic example, but without a working `isolate` system 
it's hard to make sure the entire thing is correct. So I wrote you up two 
scenarios that I've thought about using such a system for, but apparently those 
aren't good enough? Would it help if I wrote them out in code so it would be 
more explicit what I would try to do? I'd have to invent some kind of work to 
be done though since I don't have anything specific I'm working on right now.

Reply via email to