hello everybody!
i am developing a client/server application for streaming audio in linux..
i have already implemented the mp3 player and buffering...

could anybody tell me how to create threads so that the child process continues to receive the audio buffer packets while the decoding of the received buffer is done by the parent process...

as far as my understanding i think will have to use fork() to create a child process(but here a copy of the whole process will be made )..CAN the child process
access the variables of the child process and vice versa?

also is it possible for me to create a new process containing of only the code to receive the incoming buffer packets and then the parent acting upon the buffer received..

could u also send me a small piece of code of whatever suggestion so i can get along quickly?

plz help this is urgent...


You seem confused about the difference between threads and processes. To use processes you fork a child from a parent and use one of several methods for inter-process communication. To use threads you say the magic incantation:

$ man pthread

Multiple processes don't share memory, so you're required to bend over backward to have them communicate. Multiple threads do share memory, so that's easier, but also more dangerous right out of the box because you risk two threads writing to the same memory at the same time.