You are not logged in.
HI all
I know fork and vfork. But I am looking for a fork similar command, which does not copy any members from the parent process, but instead creates them how they are at a fresh program startup.
THX
Offline
members? Are you referring to the memory space? fork usually implements the memory "duplication" as copy-on-write, meaning that the new process shares the same physical pages until you write to them. If you're looking to micro-optimize someting in the fork call, you won't find it here. memset whatever it is you're trying to get as "fresh".
If you need absurdly fine grained control, use clone. still, i don't think you're able to avoid the CoW behavior, but I really can't think of a reason why you'd want to explicitly avoid this.
Offline
HI thx for your answer. The problem is this: I have a function which creates a new process with fork and then it shows up a gui widget. K all fine. But when I want to create another gui widget out of the current process, so the first gui widget, then I can't show up the new gui widget, because a QApplication event loop is already running. Actually that is only copied by fork.^^ That is a short explanation of my problem.
Last edited by ying (2011-08-30 21:57:55)
Offline
Why do you want to do this?
Anyway, use fork() + exec(argv[0], ...), or posix_spawn(..., argv[0], ...). But more than likely, the best option is a redesign.
Offline
It is very complicated to explain, why I need this. It works in combination with more than one X Server session...
Anyway, use fork() + exec(argv[0], ...), or posix_spawn(..., argv[0], ...). But more than likely, the best option is a redesign.
That won't help me. I think I could manager it with the SIGUSR1 signal.
Last edited by ying (2011-08-30 22:15:58)
Offline