Thread: How to check written in C function from library for thread safety?

  1. #1
    Registered User
    Join Date
    Sep 2018
    Posts
    38

    How to check written in C function from library for thread safety?

    Hello! I want to use an external open source library function in my C code. How do I check it before using from multiple pthreads? Thank you.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,629
    > How do I check it before using from multiple pthreads?
    Does it use any global variables?
    Does it use any static variables?
    Does it open any files for writing?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. thread safety using Interlocked
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 05-16-2008, 03:07 AM
  2. Thread safety in WinAPI
    By Magos in forum Windows Programming
    Replies: 5
    Last Post: 05-14-2006, 05:55 PM
  3. STL thread safety
    By Hunter2 in forum C++ Programming
    Replies: 4
    Last Post: 10-06-2004, 08:09 PM
  4. Thread Safety Question
    By Geolingo in forum C++ Programming
    Replies: 4
    Last Post: 05-08-2004, 11:35 AM
  5. MFC Controls and Thread Safety :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 12-06-2002, 11:36 AM

Tags for this Thread