Communicating sequential processes1/29/2024 The repetition terminates when the process west terminates.ĭo you find some similarity with Go’s channels? Apparently, it’s is. Read all the characters output by west, and output them one by one to east. So simply put the lefthand (G) side served as a conditional, or guard for the righthand (S) side.Ĭombining Guarded Command with I/O commands, CSP paper put an example as below. Let’s look at the definition of it on Wikipedia.Ī guarded command is a statement) of the form G → S, where Process P2 input value from Process P2 via input command (?) and assign it to “x”. Process P1 output value of “a” via output command (!) to Process P2.Ģ. Two Processes Communicating Under CSP (Example of Synchronization).ġ. The main Concept CSP describe is Synchronization and Guarded command. To lineprinter, send the value of lineimage for printing.įrom cardreader, read a card and assign its value (an array of characters) to the variable cardimage. Multiple concurrent processes are allowed to synchronize( communicate via named sources and destinations) with each other by synchronizing their I/O. The paper abbreviates the term processes to any individual logic that needs input to run and produce output. What turned out after reading the CSP original paper was nothing fancy - a simple concept (which was later formulated into the Process calculus to reason about the program correctness) solving concurrency through two primitives of programming. Is CSP some sort of new technique or an algorithm that makes writing concurrent code so simple? When I heard this term for the first time, I started to think that, A simple and brief introduction to CSP, it’s terminology, and it’s similarities to Go.Ĭommunicating Sequential Processes (CSP) for short, is what we hear whenever a Go concurrency is discussed and how it’s an elixir for concurrent programming.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |