Hi all,
It is possible to call a fork() cmd inside a thread?
I couldn't find any documentation on this.
Thanks
This is a discussion on fork() inside a thread within the C Programming forums, part of the General Programming Boards category; Hi all, It is possible to call a fork() cmd inside a thread? I couldn't find any documentation on this. ...
Hi all,
It is possible to call a fork() cmd inside a thread?
I couldn't find any documentation on this.
Thanks
Of course it's "possible".
Whether it's a good idea or not remains to be seen.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
what is the situation when u need(want) to fork a thread.
S_ccess is waiting for u. Go Ahead, put u there.
If that is a question in general, yes definitely you can call fork inside a thread.
If you dont have multiple threads in your code you call fork() from your main thread!
So it isn't a requirement to specify about calling fork() from a thread as it doesn't have to do much with threads.
But it remains to be seen whether calling fork() from a specific thread in your code effects the performance of your code or not.
If you have a specific problem, do state it.