Trouble when mixing POSIX and Classic API

Alexander I. Shaykhrazeev alexsh at design.morion.ru
Tue Nov 7 08:45:35 UTC 2006


Greetings,
May somebody help me solve problem with mixed API's usage: Classic and
POSIX?
I had witten small TCP multiclient server based on POSIX threads for
controlling resource. When one client connected and writing to resource it's
locked and may be freed by current owner. But if owner is shel, it's
works incorrect. Any network client may intercept exclusive write access
from this thread.
When I had analysed this behavior, I had found strange thing: shel
thread couldn't be found by POSIX routine "pthread_getschedparam" and
returns ESRCH.
It's means that owner of the lock is dead and new thread (client) may
lock exclusive write mode. But owner thread is alive.
This is not happen when owner is a POSIX thread.

Is it normal behavior? If so, I solve this another.

-- 
Alexander I. Shaykhrazeev
Morion Inc.





More information about the users mailing list