Hi,

On Samstag, 6. Juni 2009, Bas Wijnen wrote:
> On Sat, Jun 06, 2009 at 09:58:24AM +0200, Martin Preuss wrote:
[...]
> > It can't have an infinite loop: It runs in a single thread and needs
> > to do some cleanup from time to time (e.g. releasing readers and cards
> > after some timeout etc).
>
> Actually, it can, if I understand your problem correctly.  You are
> saying that a forked child will eventually die and needs to be cleaned
> up?  If you don't ignore SIGCHLD, but handle it with an empty handler,
[...]

No, that's not what I mean. Of course the daemon uses SIGCHLD to catch dying 
children (at least to prevent zombie processes).

The cleanup concerns internal structures after using a card. The readers and 
cards are not disconnected immidiately after use (because sometimes cards and 
readers are opened and closed multiple times within a short period so 
immediately releasing a reader unnecessarily adds startup and shutdown time 
and therefore prolongs the execution time for the application).

[...]
> Right.  And this is much better than running a lot, but it still means
> it can never be in swap for long.  If that can be fixed, it would be an
> improvement.
[...]

The part which can never be swapped out is only the one or two pages which 
actually contain that code. So I guess we are only talking about 4 or 8 KB 
here. Of course this could be reduced to zero given the right amount of work 
but currently that's not my highest priority.


Regards
Martin



-- 
"Things are only impossible until they're not"

Martin Preuss - http://www2.aquamaniac.de/
AqBanking - http://www.aqbanking.de/
LibChipcard - http://www.libchipcard.de/

Reply via email to