Java Question TaskID / submitRunnable

wl

Well-Known Member
Licensed User
Longtime User
Hello,

I have been reading on how to create libraties for B4A and looking at some examples. I have two questions currently:

- TaskID: I see this is used a lot. Is it just used as an identifier that is passed to eventhandlers so the B4A developper can determine where exactly it came from ? (because of being able to run the same method multiple times at the same time) ?

- submitRunnable: this is a thread pool which manages a limited list of threads (maximum 20 I think I read): if, for some strange reason, more than 20 would be started, I guess the surplus of requests would get queued ?

Thanks,

Wim
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
TaskId helps the user distinguish between different asynchronous tasks.

- submitRunnable: this is a thread pool which manages a limited list of threads (maximum 20 I think I read): if, for some strange reason, more than 20 would be started, I guess the surplus of requests would get queued ?
Due to the way that the internal thread pool is built a RejectedExecutionException will be thrown if more than 20 tasks are running at the same time. There is no queue.
 
Top