OK, the basic setup of this project is basically one function that is pulling information from a hardware device when its available in the form of a large character array and then processing that information. The problem is that i can't do too much processing because i don't want to miss any information being sent. My solution, threads and something described to me called a ring buffer.
So now my question is where do I put the functions that do the processing? In the get function that is pulling from the buffer and has the pthread_cond_wait going on, or elsewhere? For that matter where do i put the other function that gets the information? Inside a loop in the put function where the pthread_cond_signal happens, or elsewhere? If anyone has some experience with pthreads or a problem like this, any input would be helpful, thank you.
So now my question is where do I put the functions that do the processing? In the get function that is pulling from the buffer and has the pthread_cond_wait going on, or elsewhere? For that matter where do i put the other function that gets the information? Inside a loop in the put function where the pthread_cond_signal happens, or elsewhere? If anyone has some experience with pthreads or a problem like this, any input would be helpful, thank you.