gproc icon indicating copy to clipboard operation
gproc copied to clipboard

Cannot unreg_shared global property

Open macpie opened this issue 8 years ago • 1 comments

Hi,

I have found that I can register a shared global property but cannot unregister it.

Here is what I have found in gproc_dist:

reg_shared({_,g,_} = Key, Value, Attrs) ->
    leader_call({reg, Key, Value, shared, Attrs, reg});
reg_shared(_, _, _) ->
    ?THROW_GPROC_ERROR(badarg).
unreg_shared({T,g,_} = Key) when T==c; T==a ->
    leader_call({unreg, Key, shared});
unreg_shared(_) ->
    ?THROW_GPROC_ERROR(badarg).

Looks like unreg_shared is limited to c and a when reg_shared as no limitation. Is This intended?

Thanks in advance!

macpie avatar Feb 17 '17 02:02 macpie

No, this is not intended. Nor does it make sense, of course, to allow you to register an object, but not unregister it. I note also that the documentation is wrong. There is no particular reason to restrict which types of resource can be registered as shared.

uwiger avatar Jun 08 '17 14:06 uwiger