[Pcsclite-muscle] IFD polling

Ludovic Rousseau ludovic.rousseau
Tue Feb 24 14:01:51 PST 2015


2015-02-24 22:42 GMT+01:00 William Roberts <bill.c.roberts at gmail.com>:
>
>
> On Tue, Feb 24, 2015 at 11:51 AM, Ludovic Rousseau
> <ludovic.rousseau at gmail.com> wrote:
>>
>> 2015-02-24 19:13 GMT+01:00 William Roberts <bill.c.roberts at gmail.com>:
>> > The worst part to me is the timeout. Which gets us back to polling
>> > right?
>>
>> No.
>> The timeout is 10 minutes in normal case or 5 seconds in case of auto
>> power off [1] and then 10 minutes.
>>
>> You also need to support TAG_IFD_STOP_POLLING_THREAD so pcscd can stop
>> your polling function either to switch to a 5 seconds timeout or to
>> cleanly exit.
>>
>> > Ideally we would want an event based system for this. Perhaps provide a
>> > function pointer to my ifd I can call to trigger this event.
>>
>> It _is_ event based. Just return from your polling/callback function
>> on the event.
>> You can whatever event based (or not) you want in your callback function.
>
>
> There is still a timeout, so the thread that is blocking on my function
> sleeps for
> TIMEOUT, wakes up, and does what? Eventually some thread comed back around
> and calls my fn again, and the process repeats. So doesn't that constitute
> polling?

You are right. But it is a very very low frequency polling :-)

> While 10m is a long time, it should
> just block indefinitley until some other thread calls stop().

If executing some code every 10 minutes is too much CPU waste for you
then you can block indefinitely. It should just work as you want.

Bye

-- 
 Dr. Ludovic Rousseau




More information about the pcsclite-muscle mailing list