https://github.com/securitykiss-com/csp Skip to content Sign up * Why GitHub? + Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories - * Team * Enterprise * Explore + Explore GitHub - + Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - + Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing + Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} securitykiss-com / csp Public * Notifications * Star 23 * Fork 1 * Tcl library for Golang style concurrency based on Communicating Sequential Processes View license 23 stars 1 fork Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show Loading {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default Loading View all tags 1 branch 1 tag Code Loading Latest commit @greg-sk greg-sk Update README.md ... c224a4b Nov 18, 2015 Update README.md c224a4b Git stats * 18 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time LICENSE.txt license added Jun 18, 2015 README.md Update README.md Nov 18, 2015 csp.html improve docs - buffer size Jun 19, 2015 csp.man doc fix Oct 21, 2015 csp.tcl Cleanup and comments Aug 23, 2015 csp.test test and doc script Jun 19, 2015 doc.tcl test and doc script Jun 19, 2015 pkgIndex.tcl Flatten directory structure Jun 18, 2015 test.tcl test and doc script Jun 19, 2015 View code csp - Golang inspired concurrency library for Tcl Example README.md csp - Golang inspired concurrency library for Tcl The csp package for Tcl is a concurrency library based on Communicating Sequential Processes and provides two primitives namely coroutines and channels which allow concurrent programming in the style of Golang. The concepts originate in Hoare's Communicating Sequential Processes while the syntax mimics the Golang implementation. The CSP concurrency model may be visualized as a set of independent processes (coroutines) sending and receiving messages to the named channels. The control flow in the coroutines is coordinated at the points of sending and receiving messages i.e. the coroutine may need to wait while trying to send or receive. Since it must work in a single-threaded interpreter, waiting is non-blocking. Instead of blocking a waiting coroutine gives way to other coroutines. This concurrency model may also be seen as a generalization of Unix named pipes where processes and pipes correspond to coroutines and channels. [Documentation] (https://securitykiss.com/resources/tutorials/ csp_project/csp.html) [Intro] (https://securitykiss.com/resources/tutorials/csp_project/ index.php) Example package require http package require csp namespace import csp::* proc main {} { http::geturl http://securitykiss.com/rest/slow/now -command [-> ch1] http::geturl http://securitykiss.com/rest/slow/now -command [-> ch2] timer t1 400 select { <- $ch1 { puts "from first request: [http::data [<- $ch1]]" } <- $ch2 { puts "from second request: [http::data [<- $ch2]]" } <- $t1 { puts "requests timed out at [<- $t1]" } } } go main vwait forever About Tcl library for Golang style concurrency based on Communicating Sequential Processes Resources Readme License View license Releases 1 0.1.0 Latest Jun 18, 2015 Packages 0 No packages published Contributors 2 * @greg-sk greg-sk * @securitykiss-com securitykiss-com SecurityKISS Languages * Tcl 53.3% * HTML 46.7% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.