Skip to content

Commit 6faa298

Browse files
committed
Added elixir content and start of the introduction to distributed systems
1 parent 01aa2e7 commit 6faa298

File tree

20 files changed

+355
-1
lines changed

20 files changed

+355
-1
lines changed

60007 - Theory and Practice of Concurrent Programming/concurrency_in_haskell/images/explain_begin.drawio.svg

Lines changed: 4 additions & 0 deletions
Loading
Binary file not shown.

60009 - Distributed Algorithms/60009 - Distributed Algorithms.tex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@
77
\usepackage[a4paper, total={7in, 10in}]{geometry}
88
\input{../common/common.tex}
99

10+
\definecolor{threadBlue}{RGB}{204, 229, 255}
11+
\definecolor{threadYellow}{RGB}{255, 255, 136}
12+
\definecolor{threadGrey}{RGB}{238, 238, 238}
13+
1014
\begin{document}
1115
\include{titlepage/titlepage}
1216

1317
\tableofcontents
1418
\newpage
1519

16-
\end{document}
20+
\addchapter{introduction}
21+
22+
\addchapter{elixir}
1723

24+
\addchapter{credit}
25+
26+
\end{document}

60009 - Distributed Algorithms/credit/code/.gitkeep

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
\chapter{Credit}
2+
\section*{Image Credit}
3+
\begin{center}
4+
\begin{tabular}{r p{.8\textwidth}}
5+
\end{tabular}
6+
\end{center}
7+
8+
\section*{Content}
9+
Based on the distributed algorithms course taught by Prof Narankar Dulay.
10+
\\
11+
\\ These notes were written by Oliver Killane.

60009 - Distributed Algorithms/credit/diagrams/.gitkeep

Whitespace-only changes.

60009 - Distributed Algorithms/credit/images/.gitkeep

Whitespace-only changes.

60009 - Distributed Algorithms/elixir/code/.gitkeep

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
defmodule Client do
2+
def start do
3+
receive do
4+
{ :bind, s } -> next(s)
5+
end
6+
end
7+
8+
defp next(s) do
9+
send s, { :circle, 1.0 }
10+
receive do
11+
{ :result, area } -> IO.puts "Area is #{area}"
12+
end
13+
Process.sleep(1000)
14+
next(s)
15+
end
16+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
defmodule Cluster do
2+
def start do
3+
# Spawn two processes, with the function start
4+
# Server.ex and Client.ex are modules containing a public start function
5+
# Here we just use the current node, we could specify other nodes
6+
n = Node.self()
7+
s = Node.spawn(n, Server, :start, [])
8+
c = Node.spawn(n, Client, :start, [])
9+
10+
# We send the PIDs of the processes to each other
11+
send s, { :bind, c }
12+
send c, { :bind, s }
13+
end
14+
end

0 commit comments

Comments
 (0)