I have a single QNetworkAccessManager
object (as Qt docs recommend). However, I need to obtain a request from another thread, i.e. not the thread created the QNetworkAccessManager
object.
This questions has two aspects:
- As the functions (
get
,post
... ) are not markedthreadsafe
I assume that I need to use a lock before calling them. - But even if I make sure there are no 2 threads calling in parallel, issues could arise: So it could happen a
QObject
parent child relationship is set, but from objects in different threads. For that I would need to know the internals ofQNetworkAccessManager
So is it allowed to call get/post from another thread?
See Question&Answers more detail:os