Join-pattern

Join-patterns provides a way to write concurrent, parallel and distributed computer programs by message passing.

Concretely, this is done by allowing the join definition of several functions and/or channels by matching concurrent call and messages patterns.

It is a type of concurrency pattern because it makes easier and more flexible for these entities to communicate and deal with the multi-threaded programming paradigm.

[1] It could be represented by the keywords when to specify the first communication that we expected, with the and to join/pair other channels and the do to run some tasks with the different collected messages.

Join patterns first appeared in Fournet and Gonthier’s foundational join-calculus, an asynchronous process algebra designed for efficient implementation in a distributed setting.

The Join-Calculus is both a name passing calculus and a core language for concurrent and distributed programming.

Another extensions to (non-generic) Java, JoinJava, were independently proposed by von Itzstein and Kearney.

[15] Cardelli, Benton and Fournet proposed an object-oriented version of join patterns for C# called Polyphonic C#.

[18] Erlang is a language which natively supports the concurrent, real time and distributed paradigm.

Concurrency between processes was complex, that's why the project build a new language, JErlang (J stands for Join) using based on the Join-calculus.

"Join-patterns can be used to easily encode related concurrency idioms like actors and active objects.

[24] The processes of an agent is specified as a set which define its functionality including asynchronous emission of a message, migration to other location.

This location transparency is essential for the design of mobiles agents, and very helpful for checking their properties.

So all the calculus are analysed with asynchronous processes and the join pattern provides a model to synchronize the result.

And so when all messages are grab, the compiler execute the body join code corresponding to the completed model joint.

This definitions store the others pointer of the others names with a status field and a matching date structure by message.

The fundamental difference is when the guard process is executed, for the first, it was verify if all names are the pending messages ready whereas the second use only one variable and access at the others to know if the model is completed.

[9] Recent research describe the compilation scheme as the combination of two basic steps: dispatching and forwarding.

The design and correctness of the dispatcher essentially stems from pattern matching theory, while inserting an internal forwarding step in communications is a natural idea, which intuitively does not change process behavior.

They made the observation that the worth observing is a direct implementation of extended join-pattern matching at the runtime level would significantly complicate the management of message queues, which would then need to be scanned in search of matching messages before consuming them.

The features of this language are: Yigong Liu has written some classes for the join pattern including all useful tools like asynchronous and synchronous channels, chords, etc.

This example shows us a thread safe buffer and message queue with the basic operations put and get.

Parallel C# is based Polyphonic C# and they add some new concepts like movables methods, high-order functions.

[34] Cω adds new language features to support concurrent programming (based on the earlier Polyphonic C#).

[38] gives Hume[39] is a strict, strongly typed functional language for limited resources platforms, with concurrency based on asynchronous message passing, dataflow programming, and a Haskell like syntax.

CB (builds on earlier work on Polyphonic C#, Cω and the Joins Library) adopts a simple event-like syntax familiar to VB programmers, allows one to declare generic concurrency abstractions and provides more natural support for inheritance, enabling a subclass to augment the set of patterns.

CB class can declare method to execute when communication has occurred on a particular set of local channels asynchronous and synchronous, forming a join pattern.

[clarification needed] The advantage of join patterns is that they allow a declarative specification of the synchronization between different threads.

A system named "MiniJoin" has implemented to use the intermediate result to solve the others tasks if it's possible.

To Guarantee this and a high degree of parallelism, a Software Transactional Memory (STM) within a highlytuned concurrent data structure based on atomic compare-and-swap (CAS) is use.

This flow diagram shows how the join pattern is executed by a general match with different channels (wait a chord) and synchronizes the resources (free or lock).
Class diagram of the Join pattern