Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15276] iOS: Unable to create a multithreaded Titanium Mobile module

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2016-12-27T13:48:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterIngo Muschenetz
AssigneeEric Merriman
Created2013-09-18T22:30:38.000+0000
Updated2017-03-23T22:28:34.000+0000

Description

Multi­threading seems to be broken in Appcelerator iOS modules. Threads created within a proxy API method never ran, unless we added ENSURE_UI_THREAD_1_ARG(arg) to the start of the method. This is not ideal having the initial method run on the UI thread, but under the circumstances acceptable, as the bulk of the work then happens inside a further (non UI) thread, relieving the UI thread very quickly.

Comments

  1. Ingo Muschenetz 2013-09-18

    Suggestion is to use TiThreadPerformOnMainThread instead of ENSURE_UI_THREAD_1_ARG, as that allows for a block to run inside the main thread while the rest is still in the JS background thread.
  2. Hans Knöchel 2016-12-27

    The suggestion is correct. Using TiThreadPerformOnMainThread the block will be ran on the main thread without leaking context to different threads. Resolving ticket.
  3. Lee Morris 2017-03-23

    Closing ticket as Won't Fix with reference to the above comments.

JSON Source