Find the answer to your Linux question:
Results 1 to 6 of 6
Hey all! pthread_create creates and executes a new thread ,right? how do i simulate these oparations separatedly? i was reading something about creating a condition variable in the start routine, ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    pthread_create - separate run from start

    Hey all!

    pthread_create creates and executes a new thread ,right? how do i simulate these oparations separatedly?
    i was reading something about creating a condition variable in the start routine, but i couldnt understand how that would work...

    any help would be apreciated =)

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Quote Originally Posted by Scott_sp View Post
    Hey all!

    pthread_create creates and executes a new thread ,right? how do i simulate these oparations separatedly?
    i was reading something about creating a condition variable in the start routine, but i couldnt understand how that would work...

    any help would be apreciated =)
    the answer to your first question is yes, pthread_create creates and executes a new thread.
    I'm not sure what your asking in your second question, could you explain it in more detail.

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    3
    hi thx for the reply..=)

    well, imagine that i need to separate the operations create and execute...how do i simulate this behavior using pthread_create?

  4. #4
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Try looking up semaphore or info sem_wait. This will give you better control of your threads

  5. #5
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Also look into mutexes

  6. #6
    Just Joined!
    Join Date
    May 2008
    Posts
    3
    thank you!!

    iŽll look it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...