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 PostYou don't need to post up the whole program, just post up the smallest example of the problem you're having, in a snippet of code that runs and shows the problem.
Sometimes, the doctor must actually examine the patient. ;)
Jump to PostNice - you call fork() in a while(1) loop.
No wonder the system is trashed.
http://en.wikipedia.org/wiki/Fork_bomb
All 6 Replies
sergent 52 Posting Pro
alwaysLearning0 39 Junior Poster
Adak 419 Nearly a Posting Virtuoso
manaila 0 Light Poster
Salem 5,265 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.