r/computerscience • u/meloly4 • Sep 29 '20
Help Learning Multithreaded Algorithms. Can somebody please explain to me what the continuation edges represent?
22
u/Realteamjon Sep 29 '20
This could give aspirin a headache
0
Sep 29 '20
[deleted]
2
Sep 30 '20
[removed] β view removed comment
1
u/DreadedMonkey Sep 30 '20
I wouldn't. When it takes a 1000 words (or a slab of text as big as the diagram itself) to explain a diagram you're doing something wrong. It's hard not to rant at this kind of thing which is unfortunately prevelant in academia.
But if you're desperate then use tikz. Some folk use packages such as inkscape and export to svg. There's a latex sub and stackoverflow too.
5
u/thetrailofthedead Sep 29 '20
Can someone explain the concept to a 2nd year student who has never seen this type of thing?
It looks like a recursive function, one that "splits" off 2 more calls that can be executed simultaneously before "meeting" back up where they are called from?
The critical path is simply the longest continguous chain that must be executed?
How do you write something like this?
31
6
u/LabLambReddit Sep 29 '20
You use a threading API of given language, some might not have it. I donβt know how to write that in Assembly, though.
2
u/Abchid Sep 29 '20
Based only on the fact that under every box it says fib-x, and it seems connected to lower numbers when you move downwards, I think it's a way to represent the Fibonacci formula, but I can't understand how it's supposed to be read, so I can't give an explanation
4
2
Sep 30 '20
Seems like continuation edge represents creation of thread which can be run parallely. For example, continuation edge for P-Fib(4) represents creation of thread which will execute P-Fib(2). The spawn edge from that shaded circle represents actual execution of P-Fib(2)
15
u/[deleted] Sep 29 '20
Continuation edges represent the continuation of the procedural call function for the threads befor the return calls so if the procedure continues without another spawn or fork then it will return right after? P.S: please stay inside ππ