c++ - Does a class instance thread affinity have any impact on its data? -


we know qthread documentation

a qobject instance said have thread affinity, or lives in thread. when qobject receives queued signal or posted event, slot or event handler run in thread object lives in.

does thread affinity have impact on class instance data? class data become thread data?

apart above, reason asking because want pass pointer/reference of class in constructor. if being object oriented, shall not access data directly if call member function of other class, called in class's thread?

does thread affinity has impact on class data?

no, qobject's thread affinity controls thread slot , event handlers run in.

does class data becomes thread data?

class data means class static data members - can't possibly affected thread affinity of each instance. instance data isn't somehow made thread-local either: thread-local storage can limited, , there's no reason force every instance it.

apart above ...

if don't issue signal or event, normal method calls method calls.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -