We are porting some legacy C code to linux(NPTL). The old code depends very heavily on the non-preemptive threading model. One solution we are looking at is to mimic such model in linux by implementing some sort of global lock. I guess it could be like the GIL in CPython or Ruby.
Is there any reference implementation of GIL?
Thanks