Fgbase Save

Ready-send coordination layer on top of goroutines.

Project README

fgbase

Package of Go flowgraph primitives

Getting Started

go get -u github.com/vectaport/fgbase
go get -u github.com/vectaport/fgbase_test
cd $GOPATH/src/github.com/vectaport/fgbase_test
make

Overview

Go (Golang) offers direct support for concurrent programming with goroutines, channels, and the select statement. Used together they offer all the building blocks necessary for programming across many cores and many Unix boxes. But so much is possible with goroutines that constructing scaleable and reliable systems (that won't deadlock or be throttled by bottlenecks) requires the application or invention of additional concepts.

Flowgraphs are a distinct model of concurrent programming that augment channels with ready-send handshake mechanisms to ensure that no data is sent before the receiver is ready. MPI (a framework for supercomputer computation) directly supports flowgraph computation, but doesn't address flow-based computation within a single Unix process. Go with its goroutines (more efficient than threads according to Rob Pike) facilitates taking the MPI model down to whatever granularity the concurrent programmer wants.

It is not immediately obvious how to use goroutines, channels, and select to implement the flowgraph model. This framework is an attempt to illustrate one possible approach.

Features of github.com/vectaport/fgbase:

  • fgbase.Edge augments a channel with a ready-send acknowledge protocol
  • ready-send can guarantee that unbuffered writes never lead to deadlock
  • fgbase.Node augments a goroutine with an empty interface data protocol
  • an empty interface data protocol allows a small set of primitives to be reused for a wide variety of things
  • test benches at github.com/vectaport/fgbase_test

The fgbase package can be used to (manually) render flowgraphs drawn and simulated in github.com/vectaport/ipl into compilable Golang code. ipl is an implementation of a flowgraph language suggested by Karl Fant.

Wiki Topics:

Open Source Agenda is not affiliated with "Fgbase" Project. README Source: vectaport/fgbase

Open Source Agenda Badge

Open Source Agenda Rating