multithreading - Non blocking looper class in android -
looper
class in android blocks thread. used execute tasks , when arrived. in case tasks delivered looper thread intermittently, there time gap between tasks. time gap not fixed, changes per user interaction. not want infinite loop of looper class run when there not task, since consume resources. there way such thread executes task , when arrives without blocking thread ?
no. that's idea , function looper. holds thread ready dispatch new tasks (runnable
) when available.
if want thread other function, need send runnable
thread via looper.
Comments
Post a Comment