Both approaches are valid, so you may use whatever works better for you.
Just make sure not to run tasks, that may end up in the same thread pool,
if you depend on their results. Otherwise thread pool starvation is
possible.

Custom thread pools are designed for executing tasks from other tasks:
https://apacheignite.readme.io/docs/thread-pools#section-custom-thread-pools
But if you only need to perform an asynchronous operation, then a simple
Java thread pool could work.

Denis


сб, 22 дек. 2018 г. в 20:43, kellan <kellan.bur...@gmail.com>:

> Hi,
> I have a compute task that needs to query the local data set several
> hundred
> times per task. Creating another task in a custom thread pool seems to be
> the preferred method of multithreading within an already running compute
> task, but I find the overhead a bit slow. I've tried running Scala futures
> within the task, which gives me the desired results, but I've noticed some
> unexpected behavior, like the task freezing (possibly thread pool
> starvation, I'm not sure). Is there a safe, efficient way to run futures
> within a task that I know are only going to operate only on the local data
> set?
> Thanks
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Reply via email to