Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Pthread thread, look at the help, thank you! ! !

I want to accomplish the following functions :
Lane, in the main thread to read the data in the database.
Then allocated to the sub-thread to handle, thread handling data deleted from the database,
Thread the main thread can control the volume reached a certain number after waiting until a new resurgence after the thread from the thread.
I realize the code is structured as follows :
While (1)
{
//read Data
4003rd data distribution
Pthread_create (thread, null, p, null);
}

Void * p (void *)
{
For (int i = 0; i< sum; i++)
   {
4003rd data processing and other functions Call
}
}

In this code mode, the thread is not to handle private data, I used the thread private data, but how are wrong, sometimes core swaps, to help you look at the trouble, then how to handle such requests? Thank you! ! !



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com