Domanda

I want to achieve that one process should be keep on recieving the data from the client via the socket. another process is a timer task should be keep on running in parallel to call the tasks for every 2ms, 10ms and 100ms. I created a socket to recieve data and also the timer but i dont know how to run this task concurrently. could anyone help me by showing a example ??

Nessuna soluzione corretta

Altri suggerimenti

It looks like threads might be a better option for you. There is a nice comparison of threads and processes here: When is clone() and fork better than pthreads?

Try looking at these tutorial to get the idea how to program pthreads: http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html

you can use fork() system call to create a child process and run the task concurrently.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top