mtiggelman / SPI-rack

Python drivers for the QuTech SPI-rack
http://qtwork.tudelft.nl/~mtiggelman/
MIT License
5 stars 8 forks source link

add lock to spirack driver #11

Closed peendebak closed 6 years ago

peendebak commented 6 years ago

@mtiggelman @Rubenknex

mtiggelman commented 6 years ago

Shouldn't the lock also be added to the 'write_data' function?

peendebak commented 6 years ago

@mtiggelman Maybe. That depends on whether the write function in the serial.Serial is thread safe (e.g. an atomic write). The write function uses win32.WriteFile, which seems to be thread safe (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365747(v=vs.85).aspx)

We could add locks just to be safe.

mtiggelman commented 6 years ago

@peendebak I think you're right, then it's not necessary. Just the lock on the read_data should be fine then.