[erlang-questions] Confusing about gproc with global properties

Ulf Wiger ulf.wiger@REDACTED
Mon Apr 18 18:01:34 CEST 2011


Hi Greg,

Thanks for noticing. I was about to push a new version anyway, so I fixed that issue as well.

Try the latest version: https://github.com/esl/gproc/tree/v0.2.0

(A slightly bigger version update, since the change in default is BW-incompatible).

BR,
Ulf W

On 18 Apr 2011, at 17:29, Gregory Haskins wrote:

> On 4/16/11 3:39 PM, Ulf Wiger wrote:
>> 
>> Thinking about it, I'd like to change gproc:select/1 to also include global objects, in other words:
>> 
>> select(Pat) -> select({all, all}, Pat).
>> 
>> This is a backwards incompatible change, but I am guessing that not too many people use the global gproc functionality yet, so this should be the time to do it.
>> 
>> Any objections?
> 
> Sounds good to me (of course, I am biased given I do not have any legacy
> gproc code ;)
> 
> FYI: While investigating this problem I noticed there is an
> inconsistency in the QLC interface.  That is:
> 
> P <- gproc:table(props) returns both [g,l] matches, whereas
> 
> {{p, '_', Key}, Pid, Val} <- gproc:table(props)
> 
> OR
> 
> {{p, Scope, Key}, Pid, Val} <- gproc:table(props)
> 
> return only local scope matches (as I would expect given my new
> understanding of "props =:= {local, props}" in the current code base).
> I would expect all three forms to return a consistent set ([l] based in
> this case, [g,l] after your proposed change).
> 
> FWIW: The latter two invoke
> https://github.com/esl/gproc/blob/v0.1.2/src/gproc.erl#L1150, whereas
> the first form takes a different path due to the way the QLC code builds
> the matchhead as an is_var().
> 
> I'll take a crack at fixing it and send you a patch, unless this is
> considered FAD?
> 
> Kind Regards,
> -Greg
> 

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/20110418/2a804bb8/attachment.htm>


More information about the erlang-questions mailing list