From the course: Parallel and Concurrent Programming with Java 2

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Communication

Communication - Java Tutorial

From the course: Parallel and Concurrent Programming with Java 2

Start my 1-month free trial

Communication

- [Man] After decomposing the problem into separate tasks, the next step in our design process is to establish communication, which involves figuring out how to coordinate execution and share data between the task. - Hang on a sec. Do we always need communication? - Well, my dear, communication is the foundation of a good relationship. - Yeah, yeah, but I was talking about data. Some problems can be decomposed in ways that do not require tasks to share data between them. Consider the job of frosting these cupcakes. If I'm tasked to add frosting to this one, and you're tasked to add frosting to that one, even though we're operating on adjacent elements in this array, there's no need for us to communicate with each other. They're completely independent tasks. This is embarrassingly easy to make parallel. - Sure, we could spend our quality family time together in the kitchen not talking to each other, but what if there is a need to share data between tasks? Let's say we want to decorate…

Contents