LoginSignup
1
1

More than 5 years have passed since last update.

Window と Context と Threadと

Posted at

TitaniumにおけるWindow, Context, Threadについて調べた事を書き出してみました。
大いに間違ってる可能性があるので、ご注意ください。

Window

  • Window毎にjavascript contextとthreadを分けられる
  • UI処理はmain thread で、その他の処理はwindowまたはapp.jsで処理されている
  • Windowが破棄される際に、対象となるWindowで確保されたリソースは破棄される
  • app.js上で確保されたリソースはアプリ終了まで解放されないので注意
  • Windowを分け、urlプロパティを用いる事で別のJavascriptファイルに処理を分割することができる

ContextとThread

  • Titanium は マルチスレッドで動作する
  • UIのレンダリングの処理は1つのUIスレッド(又はメインスレッド)が処理する
  • Titanium におけるContext は1つのネイティブスレッド(メインUIスレッドではない)を意味する
  • UIに関連しない処理は"Context"上で実行される

Reference

As a Titanium developer, I want to understand how threading works in Titanium
https://jira.appcelerator.org/browse/TIDOC-653

Titanium.UI.Window
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.Window

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1