[Question] Why ReactInstanceManager needs to be initialized on main thread?
Kshitij09-sc opened this issue · 2 comments
Kshitij09-sc commented
Introduction
I noticed ReactInstanceManager
methods have @ThreadConfined(UI)
and has assertions around same. Wanted to understand why do we need to initialize this on main thread?
Details
Discussion points
- Can we move this to background thread and think of other ways of thread confinement and safety?
cortinico commented
Can you elaborate more?
Specifically in your title you ask:
Why SoLoader needs to be initialized on main thread?
while in the issue body you point to runCreateReactContextOnNewThread
. I'm unsure what you'r exactly asking.
Kshitij09-sc commented
Let's focus this question on ReactInstanceManager
. I noticed SoLoader & these classes are somehow linked when it comes to initialization, but to keep it specific, why ReactInstanceManager
needs to be initialized on main thread?