pthread safe library functions?

This is a discussion on pthread safe library functions? within the C Programming forums, part of the General Programming Boards category; 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 ...

  1. #1
    Alessio Stella
    Join Date
    May 2008
    Location
    Italy, Bologna
    Posts
    251

    Question 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.
    Last edited by mynickmynick; 05-06-2008 at 03:01 AM. Reason: I add a note

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Library Functions
    By gr8npwrfl in forum C++ Programming
    Replies: 0
    Last Post: 07-28-2008, 12:16 PM
  2. Library functions eg. String manipulation function
    By bhupesh.kec in forum C Programming
    Replies: 6
    Last Post: 07-08-2008, 08:32 AM
  3. Gnu Scientific Library functions
    By zdream8 in forum C Programming
    Replies: 11
    Last Post: 06-09-2008, 10:37 AM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 08:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 04:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21