[Haskell-cafe] Re: [Haskell] Top Level <-
Ganesh Sittampalam
ganesh at earth.li
Sat Aug 30 08:52:03 EDT 2008
On Sat, 30 Aug 2008, Ashley Yakeley wrote:
> Ganesh Sittampalam wrote:
>> On Sat, 30 Aug 2008, Ashley Yakeley wrote:
>>
>>> Ganesh Sittampalam wrote:
>>>> This seems fine to me. It's based on something that already does work
>>>> properly across a process scope,
>>>
>>> But you agree that IORefs define a concept of "process scope"?
>>
>> I'm not sure that they *define* process scope, because it might be safe
>> to use them across multiple processes; it depends on OS-dependent
>> properties. But they exist *at least* at process scope.
>
> How can one use IORefs across multiple processes? They cannot be serialised.
Firstly, that's a property of the current implementation, rather than a
universal one, IMO. I don't for example see why you couldn't add a
newIORef variant that points into shared memory, locking issues aside.
Also, the issue is not whether you can *use* them across multiple
processes, but whether they are unique across multiple processes.
Uniqueness has two possible definitions; aliasing, and representational
equality. No two IORefs will ever alias, so by that definition they exist
at global scope. For representational equality, that exists at least at
process scope, and perhaps more.
Ganesh
More information about the Haskell-Cafe
mailing list