bash - Synchronize access to shell variables while using Gnu parallel (i.e. critical section in Gnu parallel) -


i have for loop i'd convert parallel. however, i'm appending global (bash) array within loop. what's recommended way of dealing situation? parallel provide form of synchronization between jobs besides --keep-order?

i thought replacing array combination of flock , echo > some_shared_file, wanted know if there's standard way of implementing "critical section" parallel.

bash has "thread local" variables. there no global variables can updated different threads. variables/arrays copied subprocesses, , changes in 1 not reflected in another.

the more general answer -- if had resources updated different processes -- use sem comes gnu parallel.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -