Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit gproc:unreg() does not send unreg message for global names #50

Closed
avalente opened this issue Dec 9, 2013 · 9 comments
Closed

Comments

@avalente
Copy link

avalente commented Dec 9, 2013

It seems that "unreg" messages are not sent when an explicit gproc:unreg() is issued for global names, while it works fine for local names:

$ erl -pa gproc/ebin -pa gproc/deps/gen_leader/ebin/ -boot start_sasl -name n1@localhost -setcookie test -gproc gproc_dist "[{[n1@localhost], []}, {bcast_type, all}]"
(n1@localhost)1> gproc:start_link().
{ok,<0.49.0>}
(n1@localhost)2> gproc_dist:start_link().
{ok,<0.51.0>}
(n1@localhost)3> 
=PROGRESS REPORT==== 9-Dec-2013::18:47:08 ===
          supervisor: {local,kernel_safe_sup}
             started: [{pid,<0.54.0>},
                       {name,timer_server},
                       {mfargs,{timer,start_link,[]}},
                       {restart_type,permanent},
                       {shutdown,1000},
                       {child_type,worker}]

(n1@localhost)3> gproc:reg({n, l, test}).
true
(n1@localhost)4> gproc:monitor({n, l, test}).
#Ref<0.0.0.75>
(n1@localhost)5> gproc:unreg({n, l, test}).
true
(n1@localhost)6> flush().
Shell got {gproc,unreg,#Ref<0.0.0.75>,{n,l,test}}
ok

while for global names:

(n1@localhost)7> gproc:reg({n, g, test}).    
true
(n1@localhost)8> gproc:monitor({n, g, test}).
#Ref<0.0.0.93>
(n1@localhost)9> gproc:unreg({n, g, test}).  
true
(n1@localhost)10> flush().                    
ok
@uwiger
Copy link
Owner

uwiger commented Dec 28, 2013

Sorry, this was lost in the noise in my inbox. I'll look into it.

@avalente
Copy link
Author

Thank you very much!
Il 28/dic/2013 01:05 "Ulf Wiger" notifications@github.com ha scritto:

Sorry, this was lost in the noise in my inbox. I'll look into it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-31285892
.

@uwiger
Copy link
Owner

uwiger commented Dec 28, 2013

I have pushed some changes (both to master and to the uw-locks_leader branch), but looking at the code, I suspect that the monitoring process might sometimes get multiple notifications in the global case. I will have to see if I can provoke that.

@uwiger
Copy link
Owner

uwiger commented Dec 28, 2013

Ah, sorry, no the duplicates are filtered out in gproc_lib:notify(), by only notifying local pids.

@uwiger
Copy link
Owner

uwiger commented May 29, 2014

Assume this is ok?

@avalente
Copy link
Author

Hi,
as of rev e5500cd the example above
doesn't work yet.
Thanks

2014-05-29 10:28 GMT+02:00 Ulf Wiger notifications@github.com:

Assume this is ok?


Reply to this email directly or view it on GitHub
#50 (comment).

Antonio Valente

@uwiger
Copy link
Owner

uwiger commented Jan 14, 2015

PR #81 should finally fix this issue.

@manuel-rubio
Copy link

if @avalente isn't complaining it's meaning it's fixed. @uwiger I think you can close the ticket.

@uwiger
Copy link
Owner

uwiger commented Jun 29, 2021

Yes. Thanks

@uwiger uwiger closed this as completed Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants