sem(4) lockup in python?

David Xu listlog2011 at gmail.com
Sun Feb 5 12:41:20 UTC 2012


On 2012/2/5 20:02, Ivan Voras wrote:
> On 5 February 2012 11:44, Garrett Cooper<yanegomi at gmail.com>  wrote:
>
>>     'make MAKE_JOBS_NUMBER=1' is the workground used right now..
> David Xu suggested that it is a bug in Python - it doesn't set
> process-shared attribute when it calls sem_init(), but i've tried
> patching it (replacing the port patchfile file the one I've attached)
> and I still get the hang.
Although I don't know where is the python bug, since I don't know the piece
of source code. But general rule to use anonymous shared semaphore between
forked processes is the semaphore should be initialized in shared memory 
page
and sem_init() with pshared set 1, such as:
   sem_ptr = mmap(MMAP_SHARED);
   sem_init(sem_ptr, pshared=1, init_value);

Regards,
David Xu


More information about the freebsd-hackers mailing list