[erlang-questions] Gproc synchronization primitives?

Ulf Wiger ulf.wiger@REDACTED
Wed Apr 20 10:27:33 CEST 2011

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.

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.

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

More information about the erlang-questions mailing list