Multithreading and contexts

From version 1.2.0 pcsc-lite is much more multithreading friendly.

You have to follow some rules:

Each thread should create his own context with SCardEstablishContext() and should release it with SCardReleaseContext() when the context is not necessary any more.

If different threads share a same context, the calls to different functions of the pcsc-lite API are stored in a queue and the executions serialised for this context because there is a mutex shared for all the (critical) operations of this context.

Note: The SCF (Smart Card Framework) used by Solaris has not been updated. So if you compile pcsc-lite using ./configure -enable-scf you will still have a global lock mechanism.



2007-06-17