erlang - Ordering of mnesia events -


we’re developing application multiple processes on different nodes in distributed system subscribe mnesia events. table written 1 single process on 1 of nodes.

however uncertainty has arose if can sure receive events in same order operations on table.

e.g: mnesia:delete(tab1, somerec), mnesia:write(tab1, someotherrec)

if delete event after write event our design not work , have create other kind of notification mechanism.

also, how operations on different tables (from same process)?

mnesia:write(tab1, somerec), mnesia:write(tab2, someotherrec)

can sure event tab1 before 1 tab2? on processes , nodes?

thanks, jens

for erlang whole, sending of messages process a process b guaranteed in order.

however, messages between more 2 processes, can not guarantee messages sent a b arrive before messages sent c b, if a's messages globally sent first. scheduler, network latency or network problems (especially if a , c aren't on same node) might examples of why such guarantees hard give.

if events sent same process, ordering can sure thing. otherwise, can't trust events' order.

as mnesia events, they're managed in mnesia_subscr.erl, single gen_server taking charge of forwarding events node, no matter table. should adhere a b principle , guarantee ordered events.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -