[Pcsclite-muscle] About SHARED/EXCLUSIVE and starvation Was: Portable way to detect when a smart card is inserted

helpcrypto helpcrypto helpcrypto
Wed Sep 17 06:16:06 PDT 2014


On Wed, Sep 17, 2014 at 2:58 PM, Ludovic Rousseau <
ludovic.rousseau at gmail.com> wrote:

> >> > If A dies then the lock will be released automatically. If that does
> >> > not occur then it is a bug in pcsc-lite and you should report it.
> >
> > What locking system are you using? Flock? Mutex?
> > Can you link any source where using it? I'm very interested in this!
>
> MSGCleanupClient() (from winscard_svc.c [1]) is called when the client
> application closes (intentionally or not) the socket communication
> with pcscd.
> MSGCleanupClient() then does the cleanup (calls SCardReleaseContext).
>
> Bye
>
> [1]
> http://anonscm.debian.org/viewvc/pcsclite/trunk/PCSC/src/winscard_svc.c?view=markup
> line 968
>

This question comes to light due the problems we had in the past with our
globally-shared mutex.
In our case we have several applications invoking a library (not a service)
which had to manage concurrency.

In the beggining we used pthread_mutex, but as OSX 10.6 didnt support
pthread_mutexattr_setpshared, pthread_mutexattr_setrobust,
pthread_mutex_consistent, we ended using systemV semaphores.
In windows we used named semaphores and in linux pthread_mutex_consistent
when abandoned

Thx for the link! ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20140917/f936204e/attachment.html>



More information about the pcsclite-muscle mailing list