Thread: Threads on C

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    66

    Threads on C

    Hi, I am using c and I would like to know how to use threads on this programming language, I have looked on the internet, but I can't really find good examples or theory, please, can someone tell me how to use Threads on c or give me a few good resources (such as books or internet pages) to look.

    Thanx

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    I generally like to start on Wikipedia.
    http://en.wikipedia.org/wiki/Thread_...ter_science%29
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Jan 2006
    Location
    Berkeley, Ca
    Posts
    195
    The C programming language doesn't have threads. This is an operating system specific issue. In this case, you might want to consider getting a hold of the book "Advanced Programming in the Unix Environment", the second edition by Rago and Stevens.

  4. #4
    Registered User
    Join Date
    Aug 2004
    Posts
    66
    C do support threads, I saw someone made a simulation of a distributed Operative System by using threads, however Google is not showing me something that has to do with it , however, thanx for the recomendations, Further help would be really apreciated. By the way, is there a good advanced C programming book? all books I always find are about basics, and I want an advanced book, such as low level programming on C or something good you recommend. thx

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by louis_mine
    C do support threads, I saw someone made a simulation of a distributed Operative System by using threads,
    C does not, repeat not, support threads.

    However, most modern operating systems and C compilers that target them provide library functions that can be used to work with threads. The problem is that the methods of doing it are not standard C, and therefore vary between compilers and operating systems.

    If you're working under unix, the reference given by cdalten will be a good start. If you're working with windows NT/2000/XP Julian Templeman's "Beginning Windows NT Programming" is a bit old, but provides a good start. Most commercial operating systems that target windows come with the win32 API helpfile from Microsoft, which documents (among other things) win32 functions related to threading.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 10-17-2008, 11:28 AM
  2. Yet another n00b in pthreads ...
    By dimis in forum C++ Programming
    Replies: 14
    Last Post: 04-07-2008, 12:43 AM
  3. Classes and Threads
    By Halloko in forum Windows Programming
    Replies: 9
    Last Post: 10-23-2005, 05:27 AM
  4. problem with win32 threads
    By pdmarshall in forum C++ Programming
    Replies: 6
    Last Post: 07-29-2004, 02:39 PM
  5. Block and wake up certain threads
    By Spark in forum C Programming
    Replies: 9
    Last Post: 06-01-2002, 03:39 AM