<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.fileprocess.process.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'book.sync.php',
    1 => 'Sync',
    2 => 'Sync',
  ),
  'up' => 
  array (
    0 => 'refs.fileprocess.process.php',
    1 => 'Process Control Extensions',
  ),
  'prev' => 
  array (
    0 => 'class.shmop.php',
    1 => 'Shmop',
  ),
  'next' => 
  array (
    0 => 'sync.setup.php',
    1 => 'Installing/Configuring',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sync/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.sync.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.sync" class="book">
 
 <h1 class="title">Sync</h1>
 

 <div id="intro.sync" class="preface">
  <h1 class="title">Introduction</h1>
  <p class="simpara">
   The <code class="literal">sync</code> extension introduces cross-platform synchonization objects into PHP.
   Named and unnamed Mutex, Semaphore, Event, Reader-Writer, and named Shared Memory
   objects provide OS-level synchronization on both POSIX (e.g. Linux) and Windows
   platforms.
  </p>
  <p class="simpara">
   Automatic cleanup of acquired synchronization objects takes place during extension
   teardown. This means that if PHP prematurely terminates a script (e.g. script
   execution time is exceeded), objects will not be left in an unknown state.  The
   only exception to this is if PHP itself crashes (e.g. an internal buffer overflow).
  </p>
  <p class="simpara">
   Unnamed synchronization objects don&#039;t have a lot of use outside of a multithreaded
   scenario. Unnamed objects are more useful in conjunction with the pthreads PECL
   extension.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    Named objects require additional care to be used on all systems.
    If an object is instantiated with a specific set of parameters, it must always
    be instantiated with those parameters or the object will probably end up in an
    inconsistent state until the next reboot or a system administrator cleans up
    the mess.
   </span>
  </p></blockquote>
 </div>

 




 




 




 




 




 





<ul class="chunklist chunklist_book"><li><a href="sync.setup.php">Installing/Configuring</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="sync.requirements.php">Requirements</a></li><li><a href="sync.installation.php">Installation</a></li></ul></li><li><a href="class.syncmutex.php">SyncMutex</a> — The SyncMutex class<ul class="chunklist chunklist_book chunklist_children"><li><a href="syncmutex.construct.php">SyncMutex::__construct</a> — Constructs a new SyncMutex object</li><li><a href="syncmutex.lock.php">SyncMutex::lock</a> — Waits for an exclusive lock</li><li><a href="syncmutex.unlock.php">SyncMutex::unlock</a> — Unlocks the mutex</li></ul></li><li><a href="class.syncsemaphore.php">SyncSemaphore</a> — The SyncSemaphore class<ul class="chunklist chunklist_book chunklist_children"><li><a href="syncsemaphore.construct.php">SyncSemaphore::__construct</a> — Constructs a new SyncSemaphore object</li><li><a href="syncsemaphore.lock.php">SyncSemaphore::lock</a> — Decreases the count of the semaphore or waits</li><li><a href="syncsemaphore.unlock.php">SyncSemaphore::unlock</a> — Increases the count of the semaphore</li></ul></li><li><a href="class.syncevent.php">SyncEvent</a> — The SyncEvent class<ul class="chunklist chunklist_book chunklist_children"><li><a href="syncevent.construct.php">SyncEvent::__construct</a> — Constructs a new SyncEvent object</li><li><a href="syncevent.fire.php">SyncEvent::fire</a> — Fires/sets the event</li><li><a href="syncevent.reset.php">SyncEvent::reset</a> — Resets a manual event</li><li><a href="syncevent.wait.php">SyncEvent::wait</a> — Waits for the event to be fired/set</li></ul></li><li><a href="class.syncreaderwriter.php">SyncReaderWriter</a> — The SyncReaderWriter class<ul class="chunklist chunklist_book chunklist_children"><li><a href="syncreaderwriter.construct.php">SyncReaderWriter::__construct</a> — Constructs a new SyncReaderWriter object</li><li><a href="syncreaderwriter.readlock.php">SyncReaderWriter::readlock</a> — Waits for a read lock</li><li><a href="syncreaderwriter.readunlock.php">SyncReaderWriter::readunlock</a> — Releases a read lock</li><li><a href="syncreaderwriter.writelock.php">SyncReaderWriter::writelock</a> — Waits for an exclusive write lock</li><li><a href="syncreaderwriter.writeunlock.php">SyncReaderWriter::writeunlock</a> — Releases a write lock</li></ul></li><li><a href="class.syncsharedmemory.php">SyncSharedMemory</a> — The SyncSharedMemory class<ul class="chunklist chunklist_book chunklist_children"><li><a href="syncsharedmemory.construct.php">SyncSharedMemory::__construct</a> — Constructs a new SyncSharedMemory object</li><li><a href="syncsharedmemory.first.php">SyncSharedMemory::first</a> — Check to see if the object is the first instance system-wide of named shared memory</li><li><a href="syncsharedmemory.read.php">SyncSharedMemory::read</a> — Copy data from named shared memory</li><li><a href="syncsharedmemory.size.php">SyncSharedMemory::size</a> — Returns the size of the named shared memory</li><li><a href="syncsharedmemory.write.php">SyncSharedMemory::write</a> — Copy data to named shared memory</li></ul></li></ul></div><?php manual_footer($setup); ?>