Re: Spawn a process without exec



John Cupitt wrote:
Apparently thread cancel is very hard to implement portably. Instead I
usually have a flag somewhere which the main thread sets when it wants
the child to exit.

BTW, I assume one doesn't need any synchronization for things like
cancellation flags etc., right?  I.e. main thread could just

        ...
        child_thread->cancellation_flag = 1;
        ...

and the child thread could just

        while (!thread->cancellation_flag && !thread->job_done) {
          ...
        }

?

Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]