1 / 4

Distributed Programming

This resource delves into fundamental distributed programming concepts and notations with a focus on inter-process communication. It covers essential topics such as synchronous and asynchronous messages, the select statement, and remote procedure calls. A practical Ada example illustrates atomic transactions through a task buffer, demonstrating how entries for deposit and fetch operations can be implemented. The provided code showcases a producer-consumer model using a circular buffer, detailing how tasks interact through deposits and fetches efficiently, maintaining synchronization and data integrity.

sivan
Télécharger la présentation

Distributed Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Programming Concepts and Notations

  2. Inter-process Communication • Synchronous Messages • Asynchronous Messages • Select statement • Remote procedure calls • Atomic transactions

  3. Ada example • task buffer; • entry deposit(in value:T); • entry fetch(out value:T); • var • slots:array [0..N-1] of T; • head, tail:0..N-1; • size:0..N; • begin • head, tail, size := 0,0,0; • loop • select • when size < N => accept deposit(in value:T); • slots[tail] := value; • size := size+1; tail:=tail + 1 mod N; • or when size > 0 => accept fetch(out value:T); • value := slots[head]; • size := size-1; head:=head + 1 mod N; • end select; • end loop;

  4. Ada example contd. task produce repeat item := produce(); call buffer.deposit(item); forever; end; task consumer; repeat call buffer.fetch(item); consume(item); forever; end

More Related