Thanks, it was actually increment I was interested in.

Can one get around it with an intermediate variable?

$var(y) = $shv(x);
$shv(x) = $var(y) + 1;

I would just use a lock(), but I'm afraid that it will serialise message processing too much at high volume, due to the blocking.


On 19 November 2014 01:23:14 GMT-05:00, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
For what kind of operation?

Reading or setting the value are safe, but updating it with its own
value used in an expression is not.

Safe:

xlog("value is $sht(x)\n");
$sht(x) = 1;

Race:

$sht(x) = $sht(x) + 1;

Cheers,
Daniel

On 19/11/14 00:27, Alex Balashov wrote:
Does setting $shv()s in script require lock()ing, or is it inherently
thread-safe?

Thanks!


--
Sent from my Nexus 10, with all the figments of autocorrect that might imply.

Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/