[Insight-developers] Mac Semaphores (Was: Failing tests and compile errors after your check in)

Daniel Blezek Blezek.Daniel at mayo.edu
Fri Feb 18 12:59:07 EST 2011


POSIX semaphores are not fully supported on the Mac.  I don't know why this
works in the 64-bit version...

We are using sem_destroy to destroy our semaphores.  On the 32-bit Mac, I
get this return value (perror()):

536: sem_destroy: Function not implemented

Why this linked and run, I'll never know...  Looks like I need to add some
APPLE specific code.  I suspect this will fix the problem on the Sun.

We also have a race-condition in our Semaphore code.  On the Mac, the
semaphores need unique names.  We generate this using the time() function,
but it has a one second resolution.  Thus if two semaphores are created
within 1 second, they will collide.  Not very nice.

I'll try to track this down once again.
-dan


On 2/17/11 11:07 AM, "Bill Lorensen" <bill.lorensen at gmail.com> wrote:

> Dan,
> 
> I assume you noticed the failing tests and build errors after your
> check in yesterday?
> 
> Bill

-- 
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center

P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu

Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
"It is more complicated than you think." -- RFC 1925



More information about the Insight-developers mailing list