# more &synchronized questions

**URL:** <https://community.zeek.org/t/more-synchronized-questions/2638>\
**Category:** Zeek\
**Created:** [April 10, 2013, 3:24pm UTC](https://community.zeek.org/t/more-synchronized-questions/2638 "2013-04-10T15:24:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Mandelberg](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@David\_Mandelberg](https://community.zeek.org/u/David_Mandelberg)\
**Post date:** [April 10, 2013, 3:24pm UTC](https://community.zeek.org/t/more-synchronized-questions/2638/1 "2013-04-10T15:24:24Z")

</div>

Hi,

How does &synchronized work with records? E.g., in the below code, is the  
effect of two cluster nodes simultaneously running ++foos[0]$foo similar to  
simultaneously running ++bars[0]? Or would there be a conflict causing  
foos[0]$foo to only be incremented once?

type Foo: record {  
&nbsp;&nbsp;&nbsp;&nbsp;foo: count &default=0;  
}

global foos: table[count] of Foo &default=[] &synchronized;  
global bars: table[count] of count &default=0 &synchronized;

Also, does a "X += N" instruction propagate to all nodes as "increment by  
N" or as "set to X+N?"

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [April 10, 2013, 8:37pm UTC](https://community.zeek.org/t/more-synchronized-questions/2638/2 "2013-04-10T20:37:53Z")

</div>

> effect of two cluster nodes simultaneously running ++foos[0]$foo similar to  
> simultaneously running ++bars[0]?

Yes, it's similar. The operation is propated for the specific record  
instance being modified, along with the record field where it applies  
to.

> Also, does a "X += N" instruction propagate to all nodes as "increment by  
> N" or as "set to X+N?"

The former, it's an actual increment operation. If multiple increments  
are sent, nodes may diverge briefly while not everybody has seen all  
updates yet, but eventually they'll all arrive at the same value.

Robin

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:40pm UTC](https://community.zeek.org/t/more-synchronized-questions/2638/3 "2022-05-06T15:40:55Z")

</div>


