Thread: Threads in C

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    1

    Threads in C

    Hello Guys

    I want synchronise two threads,
    I want Thread A iteration1 to run first,
    Then Thread A iteration2 and B iteration1 together
    then Thread A iteration3 and B iteration2 together
    and so on

    Using for loops
    Problem is making sure both threads have finished before
    starting next iteration tried mutexes?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    You should be able to use pthread_join() to accomplish it. You didn't really mention which threads implementation you're using...
    If you understand what you're doing, you're not learning anything.

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