Hi,
I'm trying to create program that handles Hopper and Note Acceptor.
In LinuxDemo that is attached to examples I saw that few tasks (e.g. DataFn_UpdateDispensers or DataFn_AcceptorUpdateData) are scheduled with use of g_timeout_add (tasks processed in main thread). Can I run many calls from different threads to Paylink or i must process them sequentially ?
Can calls to library be executed simultaneously from different threads (Is library thread-safe) ?
Moderators: aardvark, davebush, Admin
Re: Can calls to library be executed simultaneously from different threads (Is library thread-safe) ?
Hi,
Nothing in the API was specifically designed to be thread safe. That said, all the API calls that are essentially reading values from the Paylink are safe.
However those issuing commands or modifying peripheral behaviour are theoretically capable of triggering the Paylink unit into action part way though the update.
The window is only 3 or 4 instructions, so it is unlikely to ever cause a problem, but to be safe I would serialize those calls.
Regards
Dave
Nothing in the API was specifically designed to be thread safe. That said, all the API calls that are essentially reading values from the Paylink are safe.
However those issuing commands or modifying peripheral behaviour are theoretically capable of triggering the Paylink unit into action part way though the update.
The window is only 3 or 4 instructions, so it is unlikely to ever cause a problem, but to be safe I would serialize those calls.
Regards
Dave
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.