I want to run several concurrent jobs from QtScript script:
function job1() { ... }
function job2() { ... }
runConcurrentJobs(job1, job2)
The jobs a essentially sequences of remote procedure calls (ZeroC Ice), which need to synchronize at several points.
The Qt 4.8.0 documentation says nothing about QScriptEngine
thread-safety. My questions:
Is it safe to use single
QScriptEngine
to exectute QtScript functions from multiple thread concurrently?What approach would you recommend to accomplish the task?
Notes:
- Scripts are edited not by programmers but also by electric engineers and I want to keep the script as simple and clean as possible.
In general, if documentation says nothing about threading, it is not thread safe.
I would rewrite to use asynchronous requests. Just kick them both off, then wait for them both.