Skip to content

Interprocess

Nako Sung edited this page Dec 8, 2015 · 2 revisions

Shared memory

let shm = JavascriptSharedMemoryRegion.Create(
  "TestSharedMemory",
  true/*create*/,true/*read*/,true/*write*/,4096/*bytes*/)
let ab = memory.access(shm)
let fa = new Float32Array(ab)

Semaphore

let semaphore = JavascriptSemaphore.Create("TestSemaphore",true/*creatE*/,4/*max-locks*/)
if (semaphore.TryLock(10/*nano seconds*/)) {
  semaphore.Unlock()
}
semaphore.Lock()
semaphore.Unlock()
Clone this wiki locally