[erlang-questions] Gproc synchronization primitives?

Ulf Wiger ulf.wiger@REDACTED
Wed Apr 20 11:03:45 CEST 2011


Never mind, but thank you Hans for offering to help.

When matching on pid, with the first part of the key unbound, gproc rewrites it to a match on the reverse mapping instead, followed by explicit lookups on the actual objects in the found set.

A while ago, I changed the representation of the reverse mapping, but forgot to rewrite the qlc query.

The newly pushed version should fix the problem. I'll remove the compilation warning later. :)

BR,
Ulf W

On 20 Apr 2011, at 10:27, Ulf Wiger wrote:

> 
> Hi Greg,
> 
> This is interesting - it looks as if QLC doesn't give gproc the chance to rewrite the match specification when there is a '=:=' instead of a '==' in the guard.
> 
> Perhaps there is some subtle option in QLC which could save the day? It would require some digging into manuals, or a helpful tip from Hans Bolinder.
> 
> BR,
> Ulf W
> 
> On 20 Apr 2011, at 03:30, Gregory Haskins wrote:
> 
>> 
>> On Apr 19, 2011, at 8:21 PM, Gregory Haskins wrote:
>>>> 
>>> 
>>> I updated and added the code, but I ran into a potentially unrelated snag before I could verify if this fixed the issue.  That is:
>>> 
>>> (agent@REDACTED)23> Pid.
>>> <0.73.0>
>>> (agent@REDACTED)24> qlc:e(qlc:q([{P, K, V} || {{p, g, {edist_fact, K}}, P, V} <- gproc:table(props), K =:= "hostname"])).
>>> [{<0.73.0>,"hostname","linux-mp"}]
>>> (agent@REDACTED)25> qlc:e(qlc:q([{P, K, V} || {{p, g, {edist_fact, K}}, P, V} <- gproc:table(props), P =:= Pid])).       
>>> []
>> 
>> It looks like "P == Pid" does in fact work.  I am not clear if the problem with using =:= is gproc, erlang/qlc, or "pilot error" specific, but that does seem the be the problem in this case.
>> 
>> BTW: I did in fact confirm that the sync() in v0.2.3 seems to be working fine, thanks!
>> 
>> -Greg
> 
> Ulf Wiger, CTO, Erlang Solutions, Ltd.
> http://erlang-solutions.com
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110420/27c3bccc/attachment.htm>


More information about the erlang-questions mailing list