Is the SUB-20 libraryTHREAD SAFE ...??
Moderator: serg
Is the SUB-20 libraryTHREAD SAFE ...??
Hello everyone, i am working with the SUB-20 adapter and want to use multi-threaded programming. I have read the libraries and found that there are many global and static variables. So i wanted to make sure if it is thread safe. I don't see a mention of thread safety anywhere in the documentation though. Kindly help!!.
Re: Is the SUB-20 libraryTHREAD SAFE ...??
Hi,
What operating system are you going to use?
And what kind of API requests?
You need to understand that USB system is not multi-thread/multi-process oriented. USB device can not perform a number of request at the same time.
What operating system are you going to use?
And what kind of API requests?
You need to understand that USB system is not multi-thread/multi-process oriented. USB device can not perform a number of request at the same time.
Re: Is the SUB-20 libraryTHREAD SAFE ...??
Hey thank you for the reply,xol wrote:Hi,
What operating system are you going to use?
And what kind of API requests?
You need to understand that USB system is not multi-thread/multi-process oriented. USB device can not perform a number of request at the same time.
Well i am using linux(ubuntu10.10) and basically i have a scenario where i have to read GPIO and SPI using two different threads. I am aware that the SUB-20 will process these requests sequentially but my program involves receiving simultaneous messages. So how can i proceed?

Re: Is the SUB-20 libraryTHREAD SAFE ...??
Hi,
Under Linux we use libusb 1.x, which is multithreded with some considerations mentioned here: http://libusb.sourceforge.net/api-1.0/mtasync.html
For us if you care to serialize SUB-20 API calls, which means next API call waits for termination of the previous call, we have no problems.
Under Linux we use libusb 1.x, which is multithreded with some considerations mentioned here: http://libusb.sourceforge.net/api-1.0/mtasync.html
For us if you care to serialize SUB-20 API calls, which means next API call waits for termination of the previous call, we have no problems.
Re: Is the SUB-20 libraryTHREAD SAFE ...??
thanks for the info. and the sourceforge document it is of great help.