multithreading - Java mastar-worker communication -


here's need:

a master task create bunch of worker tasks.

once each worker finishes job, needs report master.

as master receives predefined number of responses, save these results. needed because inserting results 1 one take more time inserting bunch of them @ once , waiting results might result in outofmemoryexception.

i've looked each worker calling method on master , synchronizing wait() , notify() , using threadpoolexecutor , afterexecute(..) method getting result workers, i'm still not sure best way achieve need.

edit: should mention java app.

use blockingqueue master waits (queue.take()) worker place result (queue.put()).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -