Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreaded NI-488.2 GPIB-ENET driver for Solaris

Hi: we are using GPIB/ENET-100 for LAN access to Tektronix oscilloscopes. OS: Solaris 2.8, driver currently installed: NI-488.2M GPIB-ENET SPARCstation Driver for Solaris 2.X February 2001 Version 1.4. With multiple scopes, the throughput and response of the system are getting limited by a single-thread nature of the NI-488.2 driver (global ibsta, iberr, etc). We have added GPIB-ENET/100 boxes, the scopes are spread over the multiple boxes and GPIB buses, but it does not improve the performance, as the bottleneck is in the driver. Latest Windows drivers seem to have multithreaded support with ThreadIbsta(), ThreadIberr(), etc. Is there a similar multithreaded NI-488.2 driver available for Solaris 2.x and GPIB-ENET/1
00? Any other concurrent solutions?
0 Kudos
Message 1 of 5
(3,257 Views)
Mike,

The ThreadIbsta(), ThreadIberr(), and ThreadIbcntl() functions are designed so that customers who use multithreading in their applications have a thread-safe way to get the ibsta, iberr, and ibcntl global variables.

These functions are not provided in the Solaris version of the driver, but this does not mean that you cannot use the driver in a multithreaded appliction. You simply need to be aware that the ibsta, iberr, ibcntl globals are allocated on a per-process basis. Thus, you cannot depend on these globals to be valid for every thread all the time. If thread 1 makes a call to ibconfig and thread 2 makes a call to ibwrt then reads the ibsta global, you cannot be assured that the ibsta is the result of thread 2's ibwrt; it may be that thre
ad 1's ibconfig wrote to ibsta. To read ibsta, you can simply examine the return of the ib-style function since most of them return the value of ibsta anyway.

To your questions about whether there is another driver for Solaris, you do have the latest version for your configuration. I do not know offhand whether or not the Solaris driver itself takes advantage of Solaris's multithreading capability. If this information is still important to you, I can do some reasearch and possibly find out.

Hope this helps.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,257 Views)
Thanks for the reply, Scott. We have a multithreaded application and because of the thread safety concerns we have a mutex serializing access to NI-488.2 API. It works, but because we cannot poll several boxes in parallel, we cannot achieve our target polling rate regardless of over how many separate GPIB-ENET boxes we spread our digitizers. Besides ibsta, iberr, ibcnt -- are there any other internal globals which could be messed up when NI-488.2 functions are called concurrently? State variables? I/O buffers? If these internals are on per-process globals, then the library is still not thread-safe. Please investigate this issue further to have a definitive answer on thread safety of the NI-488.2 version 1.4 for Solaris 2.x. Again, the concurrency we a
re trying to achieve is between multiple GPIB-ENET boxes, we are not asking about a more troublesome case of multiple parallel connections to the same box. Best regards,
0 Kudos
Message 3 of 5
(3,257 Views)
Mike,

Thanks for clarifying your question. The answer is that NI-488.2 for Solaris 2 is multithread safe. The *only* potential for problem are the global variables that we already mentioned. If you can use a mutex whenever you need these variables to be valid or can get the variable information in other ways, you should be all set to take advantage of Solaris's multithreading capability.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,257 Views)
I need to correct this post. The PCI-GPIB driver for Solaris is multithread safe. The ENET/100 driver for Solaris is not multithread safe. I apologize for the confusion.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(3,257 Views)