Joins (concurrency library)

Joins (concurrency library)

Joins is an asynchronous concurrent computing API from Microsoft Research. It is based on join calculus and makes the concurrency constructs of the language available as a .NET library that any .NET language can use.

Overview

Joins can be used to express concurrency in an application using the joins pattern, usable both for multi-threaded applications as well as for event based distributed applications. The Joins API emulates declarative type-safe expression of synchronization patterns.

The Joins library emulates asynchronous and synchronous methods. An asynchronous method, in Cω and Joins parlance, is one which does not block the caller method, nor does it return any result, whereas a synchronous method blocks the caller method. In the Joins API, synchronous as well as asynchronous methods are implemented as generic delegates. Usage of generics provide type safety. For example, a set of synchronous and asynchronous method can be created and using them to create an object that implements the pattern, as: public class JoinDemo { public readonly Asynchronous.Channel Queue; public readonly Asynchronous.Channel Send; public readonly Synchronous.Channel Retrieve; private Join joinPattern = Join.create(); public JoinDemo() { joinPattern.Initialize(out Queue); joinPattern.Initialize(out Send); joinPattern.Initialize(out Retrieve); } }

When asynchronous methods are called, the parameters are put in a channel, which is a queue managed by the Joins runtime. The method can optionally start a new thread to process the parameters in the background, and return the results. When the corresponding synchronous method is called the parameter is returned for further processing. If no parameter is present in the queue when the synchronous method is called, the caller stalls. The Joins runtime schedules which parameter is returned based on whether it is ready.

The synchronization pattern of the methods are defined by "joins patterns", which describes what happens when a set of channels are invoked. For example, what happens when "Send" and "Retrieve" are called together can be different than "Send" and "Queue".

public void SetPatterns() { join.When(Send).And(Retrieve).Do(delegate (string s) { return s; }); join.When(Queue).And(Retrieve).Do(delegate (int n) { return n.ToString(); }); join.When(Send).And(Queue).And(Retrieve).Do(delegate (string s) { Send(s); return Retrieve(); }; }

References

* [http://research.microsoft.com/~crusso/papers/padl07.pdf The Joins Concurrency Library]
* [http://research.microsoft.com/~crusso/papers/tutorial.pdf Joins — A Concurrency Library]

External links

* [http://research.microsoft.com/research/downloads/Details/f9d6994e-45f6-49b8-b3c9-2a44bb2a4c50/Details.aspx Joins at Microsoft Research]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Joins (библиотека) — У этого термина существуют и другие значения, см. Join. Joins асинхронный API для параллельных вычислений, разработанный Microsoft Research для .NET Framework. Библиотека основана на соединительном исчислении и делает конструкции параллелизма… …   Википедия

  • Concurrency and Coordination Runtime — (CCR) is an asynchronous programming library based on .NET Framework from Microsoft distributed with Microsoft Robotics Developer Studio (MRDS). Even though it comes with MRDS, it is not limited to modelling robotic behavior but can be used to… …   Wikipedia

  • Concurrency and Coordination Runtime — (CCR)  библиотека для работы с параллельными и асинхронными потоками данных, базирующаяся на .NET Framework от Microsoft, поставляемая в комплекте с Microsoft Robotics Developer Studio (MS RDS). Несмотря на то что данная библиотека… …   Википедия

  • Parallel FX Library — (PFX) is a managed concurrency library being developed by a collaboration between Microsoft Research and the CLR team at Microsoft for inclusion with a future revision of the .NET Framework. It is composed of two parts: Parallel LINQ (PLINQ) and… …   Wikipedia

  • — Paradigm(s) multi paradigm: structured, imperative, object oriented, event driven, functional Appeared in 2003 Desig …   Wikipedia

  • — Objektorientierte Programmiersprache Basisdaten Paradigmen: multiparadigmatisch: strukturiert, imperativ, objektorientiert, funktional …   Deutsch Wikipedia

  • — Класс языка: распределенный, data oriented Тип исполнения: компилируемы …   Википедия

  • Join — may refer to: * Join (law), to include additional counts or additional defendants on an indictment * Join (mathematics), a least upper bound in lattice theory * Join (relational algebra), a type of binary operator * Join (SQL), a SQL and… …   Wikipedia

  • Interstate 93 — Route information Length …   Wikipedia

  • U.S. Route 60 — For the U.S. Route 60 in the 1925 plan, see U.S. Route 66. U.S. Route 60 Route information …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”