guy keren wrote:
Lev Olshvang wrote:
Hi friends,

I seems that i have buggy implementation of pthread_timedjoin_np.

Although linux does not documented this function yet ( see http://www.kernel.org/doc/man-pages/missing_pages.html ), I suspect that on my installation this function does not work properly because it returns sometimes 0, sometimes 110 and does not set errno to ETIMEOUT.


After some googling I still do not know how to get thread status.

As an idea i thought about using the futex() to check memory pointed my thread handle, but I am almost sure this solution (if pthread handle indeed references memory) is dirty, ...

I saw on this list people with experience in thread programming and I am hope for you help.

Cheers,
Lev

Hi Lev,

why do you want to use this non-posix API in the first place?

APIs ending with '_np' are not part of the pthreads spec - and thus are not portable and should be avoided.

why can't you use the standard pthread_join API?

and if you need a work-around you can use some portable mechanism, e.g. synchronizing using a condition variable, having the inner thread signal it just before terminating, and the outer thread waiting on it just before calling pthread_join?

--guy


Hi,

I am looking for generic way to ask about  thread existence.

The problem is that I create thread for third party function, so I can not add to this function code to use thread signalling and cond variables.

Yes, I know that _np functioins are GNU extensions to POSIX, but I did not found way to query
thread aliviness.

Thanks for answer.
L.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to