tcmon
tcmon

Reputation: 3

erlang : ordering of trace messages originating from a single process

That is the simple question, i can not find a clear answer to:

Can one assume that the order of trace messages belonging to a single process are sent in the order in which corresponding events occur ?

(The icing on the cake would of course be the source where is is specified :) )

thank you

Upvotes: 0

Views: 118

Answers (1)

I GIVE TERRIBLE ADVICE
I GIVE TERRIBLE ADVICE

Reputation: 9648

Messages from a process A to a process B are guaranteed to always be ordered. It would be right to assume the trace events will also be ordered.

This guarantee doesn't hold when many processes message another one: if A and C both message B and A fires before C, there is no guarantee that A's message will be there first. Similarly, if A messages both B and C, there is no guarantee that C won't have its messages before B.

This could cause confusion if there is IO being done while tracing -- IO goes through a specific process (the group leader) that acts as a server, so outputting trace vs. stuff that is happening right now might give funny results.

Upvotes: 2

Related Questions