cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
pthread_testcancel() before and after re
pthread_testcancel() before and after read(...)
Oct 1, 2012 at 5:01pm UTC
DeepBlack
(36)
What is the significance of calling pthread_testcancel() before and after a read(...) call?
Oct 1, 2012 at 6:09pm UTC
Cubbi
(4774)
Perhaps the original author of that code was writing for a non-POSIX system where
read()
is not a cancellation point? Normally, pthread_testcancel() after read() is redundant.
what testcancel does:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_testcancel.html
other cancellation points (includes read()):
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_05_02
Oct 1, 2012 at 6:21pm UTC
DeepBlack
(36)
Thank you! I have one more question and googling did not give me an easy answer.
Why exactly should we create cancellation points?
Last edited on
Oct 1, 2012 at 6:22pm UTC
Oct 1, 2012 at 7:06pm UTC
Cubbi
(4774)
They make it possible to terminate a thread without terminating the whole process.
Topic archived. No new replies allowed.