Hi
I have a large C program which executes continuously, that is listening to the user inputs, it is in an event loop. Now I want to have two different functions in that code to be executed simultaneously, in parallel. I tried to use fork() but the problem is in fork each process will be executed after the other one has exited, but my program never exit. Using pthreads didnt help...
Any ideas, maybe I'm missing something!
manaila
0
Light Poster
Recommended Answers
Jump to PostCan you show us the code? And which functions you want to use. You don't always have to thread.
Jump to Postfork() creates a copy of a parent process and all the descriptor is opened by the parent process is also shared by forked children.
If you use fork() to create children, then parent process or a child process doesn't need to wait for other children or parent to get …
All 6 Replies
sergent
52
Posting Pro
alwaysLearning0
39
Junior Poster
Adak
419
Nearly a Posting Virtuoso
manaila
0
Light Poster
Salem
5,138
Posting Sage
manaila
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.