0

The qt docs define the thread safety as https://doc.qt.io/archives/qt-4.8/threads-reentrancy.html

A thread-safe function can be called simultaneously from multiple threads, even when the invocations use shared data, because all references to the shared data are serialized.

To be a thread safe function either the critical section must be locked using mutex or the function should access its own copy of data. Why does serialization guarantee thread safety ? How does serialization related to thread safety?

Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
  • This is supposed to be a general definition i think, not Qt-specific nor very low-level. Where serialized access means: "one at a time", which can be implemented with a mutex, for example. – Frank Osterfeld Dec 30 '19 at 07:16
  • "one at a time" - citation required. – Talespin_Kit Dec 30 '19 at 07:24
  • See e.g. https://stackoverflow.com/questions/14654230/what-does-it-mean-by-thread-serialization-in-c for the meaning in MT context, i.e. the more generic "putting things (accesses) into a sequence", opposed to "convert data structure into a byte sequence and back" – Frank Osterfeld Dec 30 '19 at 13:16

0 Answers0