A hands-on exploration of Lynx JS's dual-thread runtime model, using a modified Gallery tutorial to make the threading behavior tangible. The author introduces a 'Jammer' technique — deliberately blocking the background JavaScript thread — to visually demonstrate how main-thread-bound UI code (scroll indicators, animations) stays responsive while background-thread code stalls. Code examples show how Lynx exposes threading explicitly through APIs: the 'main thread' directive, useMainThreadRef, and main-thread:bindscroll props. The key insight is that blocking background JS doesn't have to freeze the entire UI if interaction-sensitive work is wired to the main thread.
Table of contents
Quick recap: what Lynx is aiming forMy struggle: how do you “see” two threads?The Gallery tutorial gives you working code… and hides the feelingThe Jammer trickExtending the Gallery: BTS JammerWhy this happensAPI asideSort: