android - Associate same looper with different threads -
in application, want create multiple threads working on single queue. create queue know need call looper.prepare()
.
i want other threads create should associated looper
created first thread, how can achieve this?
use 1 of java thread safe queue class java.util.concurrent
package instead of looper achieve goal. it's more common practice.
share queue between threads , post task queue entry 1 thread can entry thread. blockingqueue
can - in 1 thread call take() , block thread until thread put() entry queue. that's all.
producer consumer pattern example
Comments
Post a Comment