diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-20 16:55:48 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-21 06:33:48 +0000 |
commit | c895162296dddde2aaa173499d7b59c0034734ac (patch) | |
tree | 245402d11b394dfe0f5cec962f320f302b8cde44 /src/qml/types/qquickworkerscript.cpp | |
parent | cd3e2588e672a9ceea0c165a84bcd2ab89ab708f (diff) |
Clarify docs of WorkerScript with regards to memory usage
Since now each WorkerScript has its own JS engine, let's document that
to explain the reason (isolation), impact (memory consumption) as well
as how to deal with it (sharing).
Change-Id: I8007a58aaa96f989bc9e72e68dacd87655a8a8cc
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index f8616bf709..cf3bead048 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -512,6 +512,10 @@ void QQuickWorkerScriptEngine::run() If a worker script has the extension ".js" instead, then it is considered to contain plain JavaScript statements and it is run in non-strict mode. + \note Each WorkerScript element will instantiate a separate JavaScript engine to ensure perfect + isolation and thread-safety. If the impact of that results in a memory consumption that is too + high for your environment, then consider sharing a WorkerScript element. + \section3 Restrictions Since the \c WorkerScript.onMessage() function is run in a separate thread, the |