title: Synchronizing multiple instances of same Greasemonkey script
body: <p>I have a Greasemonkey userscript, that operates on task queue. This queue is bunch of serialized JSON objects, scattered across script private preference space, to be accessed with <code>GM_getValue</code>, <code>GM_setValue</code> and <code>GM_listValues</code>.</p>
  
  <p>I'd like to make this script run simultaneously (same machine, same browser, different tabs), while still keeping shared queue. I know Javascript mostly runs in a single thread (except for Web Workers), but I suppose it's not the case for pages opened in separate tabs, so it has to run concurrently.</p>
  
  <p>In this case, how can I properly organize shared access to such an object, to prevent race conditions? Will race conditions appear at all?</p>