:: Re: [DNG] Doing away with multi-thr…
Inizio della pagina
Delete this message
Reply to this message
Autore: Edward Bartolo
Data:  
To: Rainer Weikusat
CC: dng
Oggetto: Re: [DNG] Doing away with multi-threading in my project (netman)
Oooop, the algorithm is not periodic, but is used whenever the user
clicks connect and disconnect. Other operations can also be included.

On 04/09/2015, Edward Bartolo <edbarx@???> wrote:
> A periodic algorithm is now implemented in the frontend to search for
> backend and any spawned children for ownership by root. This most
> probably was what was causing waitpid and wait to fail to reap
> zombies. If the algorithm find a root process parented by the
> frontend, it will disable 'connect' and 'disconnect' until the process
> dies. This prevents against having multiple threads initiated by
> impatient users.
>
> The next step is semi/automatic wifi connection.
>
>
> Edward
>
> On 04/09/2015, Rainer Weikusat <rainerweikusat@???> wrote:
>> Edward Bartolo <edbarx@???> writes:
>>
>>> Hi,
>>>
>>> For the last days I have been struggling to reap zombies adopted by
>>> the frontend with only failures.
>>
>> The frontend doesn't adopt zombies. Only init ever does that.
>>
>>> I tried several methods using wait(-1), waidpid and trapping the
>>> signal when a child dies without ever succeeding to reap zombies. This
>>> means, I will stop and will leave the issue open to anyone who can
>>> find a working solution.
>>
>> The 'zombie reaping' needs to happen in the parent process. This means
>> the backend has to care for any processes it starts via fork. And the
>> frontend has to care for the backend. You can get a tree view of
>> processes via ps f, eg,
>>
>> ps fx
>>
>> to show all processed running under you current uid.
>>
>> [...]
>>
>>
>>> initialization
>>>
>>> sa.sa_handler := @handle_sigchld;
>>
>> Insofar the documentation goes, you should be able to replace this with
>>
>> sa.sa_handler := SIG_IGN;
>>
>> this means now direct backend processes will ever be zombified. As the
>> backend is written in C, a single
>>
>> signal(SIGCHLD, SIG_IGN);
>>
>> will take care of all processes spawned by the backend.
>> _______________________________________________
>> Dng mailing list
>> Dng@???
>> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
>>
>