pthread safe library functions?
|
Author |
Message |
|
|
Posted : Mon, 05 May 2008 15:10:14
Subject :
pthread safe library functions?
In linux using pthreads
When I call a whatever usual function like for instance:
thread 1
a=div(b,c).rem
thread 2
x=div(y,z).rem
so I call the same function on different (not shared) data
Can I be sure that the two function calls by the two threads do not share any (internal) data (may be registers or global-library-shared) and so have no side unpredicted effect??
The same question holds for usual functions like sin() exp() pow() rand() nanosleep() etc.
|
|
|
|
Shashank Sharma
|
Posted : Thu, 08 May 2008 13:30:54
Subject :
pthread safe library functions?
astella, I get all sorts of results when I search for this, so not sure how helpful, if at all, any of these links are. They discuss things like "thread safety" and "mutexes":
http://www-128.ibm.com/developerworks/library/l-pthred.html
http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
http://students.cs.byu.edu/~cs460ta/cs460/labs/pthreads.html
Cheers!
|