After some mails between NdK and me, i have been thinking a bit about
whats the best/most appropiate solution for concurrent access on
Then i realize theres a lot of people in here how knows a lot about
this, so please tell me what you think.
Consider the following scenario:
Process P1 and P2 are using smartcard. P1 want to do some
operations without being interrupted (either the card being reset by
others), at the same time (a bit later) P2 want to do some stuff too.
//SCardConnect with SCARD_SHARE_EXCLUSIVE
In one hand (option A), openning exclusive mode grants P1 exclusive
access, doesnt let others reset the card, and other process trying to
connect will get an error and could retry after some sleep.
In the other hand (option B), transactions block P2 until P1 ends, but
doesnt involve retries and sometimes is more friendly.