M Martin Beukes Member Licensed User Longtime User Apr 26, 2018 #1 Greetings, How would one go about moving service onto other threads so that app responsiveness is not degraded when long tasks (like internet comms and database actions) need to be run. Thanks, Sorry for the noob question! Martin
Greetings, How would one go about moving service onto other threads so that app responsiveness is not degraded when long tasks (like internet comms and database actions) need to be run. Thanks, Sorry for the noob question! Martin
Erel B4X founder Staff member Licensed User Longtime User Apr 26, 2018 #2 Martin Beukes said: internet comms Click to expand... Internet communication is already executed with background threads (assuming that you are using OkHttpUtils2). Martin Beukes said: database actions Click to expand... Use the async methods and they will not block the main thread. [B4X] SQL with Wait For Upvote 0
Martin Beukes said: internet comms Click to expand... Internet communication is already executed with background threads (assuming that you are using OkHttpUtils2). Martin Beukes said: database actions Click to expand... Use the async methods and they will not block the main thread. [B4X] SQL with Wait For
Semen Matusovskiy Well-Known Member Licensed User Apr 26, 2018 #3 It seems to me, the question assumes that activities and services use one thread only and in any moment one program (activity or service) is executing.. Is it true ? It's important to me to be sure that it's not necessary to lock something. Upvote 0
It seems to me, the question assumes that activities and services use one thread only and in any moment one program (activity or service) is executing.. Is it true ? It's important to me to be sure that it's not necessary to lock something.
Erel B4X founder Staff member Licensed User Longtime User Apr 26, 2018 #4 Semen Matusovskiy said: It seems to me, the question assumes that activities and services use one thread only and in any moment one program (activity or service) is executing.. Is it true ? Click to expand... I'm sorry but you should never post questions in existing threads. Start a new thread instead. Upvote 0
Semen Matusovskiy said: It seems to me, the question assumes that activities and services use one thread only and in any moment one program (activity or service) is executing.. Is it true ? Click to expand... I'm sorry but you should never post questions in existing threads. Start a new thread instead.