Menu

#7 Mutex locking on pointers

1.0
closed
nobody
None
2019-01-03
2013-11-05
No

It is undefined behaviour to access the same pointer (context/socket) concurrently from different threads. ZMQ is NOT thread-safe. LabVIEW programmers are not used to such restrictions, and violating this contract often results in RTE termination - which is extremely undesirable and hard to debug.

Consider associating a mutex (posix/Win32) with each socket which must acquire a lock before using the pointer. A further drive towards a layer of object wrapping at the C-level as considered in 6b7ef575fdf1

Discussion

  • Martijn Jasperse

    Added EBUSY code in bfe0db1eef43 to return lock failure to user in existing scheme

     
  • Martijn Jasperse

    Implemented DVR/IPE paradigm for thread locking pointers on LabVIEW-side (rev 3cb0294ea984)

     
  • Martijn Jasperse

    • status: open --> accepted
     
  • Martijn Jasperse

    • status: accepted --> closed
     
  • Martijn Jasperse

    DVR paradigm performs this function reliably, ceased using MUTEX locks in the C code in r243 and removed in r262

     

Log in to post a comment.