Thread safety - PicoScope 6402 series

Post your Linux discussions here
Post Reply
andrejm
Newbie
Posts: 0
Joined: Sun Mar 23, 2014 7:25 pm

Thread safety - PicoScope 6402 series

Post by andrejm »

Hi,

I use one PicoScope 6402 with the 64bit libps6000.so library. I currently perform device configuration (ps6000MemorySegments, ps6000SetTrigger family, ps6000SetEts) in one thread and channel specific configuration (ps6000SetChannel, ps6000SetDataBuffer) in a second thread.

Is it safe if two threads both call a different ps6000 function?

What about if two threads both call the same ps6000 function, for example ps6000SetChannel or ps6000SetDataBuffer. Is the library thread safe?

Thanks,
Andrej

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: Thread safety - PicoScope 6402 series

Post by Karunen »

Hi Andrej,

If a function is sent to the driver while it is still executing a function,
then it will put the second function on hold until the first function has finished executing.

Thanks,
Karunen

Technical Specialist
Pico Technology

andrejm
Newbie
Posts: 0
Joined: Sun Mar 23, 2014 7:25 pm

Re: Thread safety - PicoScope 6402 series

Post by andrejm »

Thanks for the info Karunen.

What happens if I use multiple PicoScope units in multiple threads? For example if call ps6000GetValues in two threads at the same time, one for each device. Would ps6000GetValues functions execute in parallel or would one wait for the other to finish?

Best regards,
Andrej

mario_
Site Admin
Site Admin
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Thread safety - PicoScope 6402 series

Post by mario_ »

Hi Andrej,

There can be only one unit open in per process. To open multiple devices you would need one process per device - but then they would work seamlessly (assuming there is enough bandwidth on usb bus).

Regards,
Mario

hmaarrfk
Newbie
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm

Re: Thread safety - PicoScope 6402 series

Post by hmaarrfk »

Does that mean that if I want to use multiple Picoscopes, I need to start forking off different processes???

Are there any plans to allow one process to communicate with multiple picoscopes?

mario_
Site Admin
Site Admin
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: Thread safety - PicoScope 6402 series

Post by mario_ »

Hi hmaarrfk,

You could try dynamically loading another instance of libps6000.so to see if it works, ( should, but I haven't try that yet ;) ).

The feature has been recognized some time ago and is in the current pipeline. However it has to be introduced in windows drivers first to allow porting to Linux version.

Mario

Post Reply