how i know if a thread finish?
There’s one special secret Sale link on Amazon:
This is open every Friday and ONLY on Fridays!
You can find very good discounts here, although some Fridays you can really get
lucky and make off like an Amazon bandit – IÂ´ve seen discounts there as low as 75%
off sticker Price.
I am new to the subject of thread. Can someone tell me why is the average time that using pthread_create() to creat a thread is shorter than using fork() to create a process?
My thought is that because parent process has to wait for each child process. On the other hand, thr_create.c includes which only needs to wait for the last thread. Am I correct?
Threads are faster than a fork() because their overhead is much smaller, as they share the same memory space than their creator. This is why it takes about 30 times less time to create a pthread than fork the current process.
As for the parent waiting for the children to terminate, it’s up to you. If you create your threads “detached”, they will liberate their own memory space automatically as they terminate. Otherwise, you have to join in order for the threads to return their memory to the heap cleanly.
Hey i have a question, if i am using pthreads, each of them perform a function, these functions need to be executed in a cylcle…. but the pthread dies everytime the cycle starts, how do i keep my thread alive??
I want to execute a thread after some specific time only…lets say 10 to 15 seconds. SLEEP is not workint… it suspends whole program… I want to suspend thread only…
Is there any way out for that?
p.s: Time granularity and accuracy doesn’t matters a much.
Real World Haskell
Mercurial: The Definitive Guide
The Jini™ Specification