There is a bug report that states that the following cannot be implemented
in PHP because of the semaphore auto-release on process exit feature:

READER:
                p(mutex);
                readcount++;
                if (readcount is 1) then p(db); // marks db for auto-release
                v(mutex);
                CRITICAL REGION where we read
                p(mutex);
                readcount--;
                // Only release if no-one else is reading
                if (readcount is 0) then v(db);
                v(mutex);

When the script has finished, PHP will vacate the db semaphore automatically,
but that will screw up synchronization with the writer which will just 
acquire the db semaphore and start writing while there are still readers...

Does anyone know of any good reason why we can't put a flag into the
sysvsem_sem struct that says not to bother with auto-releasing?

--Wez.

-- 
Wez Furlong
The Brain Room Ltd.


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to