Hacker News new | ask | show | jobs
by usrusr 2338 days ago
On Android: being paranoid about multithreading in all the wrong places before I stopped worrying and love the main thread.

Move actual work off thread whenever possible, but never try to integrate off threat memory access by hand using synchronized and friends, just enqueue your final result plumbing on the main looper.

Be paranoid about multithreading in the right places, particularly when you hand a callback to some black box. A callback that checks the thread it's running on to enqueue itself on main if necessary might become a familiar pattern. You might start to hate all callback methods that don't return void.