A random text generator using a parallelized version of the Markov chain algorithm implemented here.
Explores Go's extensive concurrency primitives (goroutines, channels, mutexes, barriers, etc.) and synchronization techniques with a goal to achieve speedup in a pretty fun/interesting application.
Goal: To parallelize Markov chain creation for random word generators in Go. The Markov chain is stored as a map from prefixes to suffixes which is built upon/written to by multiple threads and thus needs to be synchronized.
coarse-grain
compares synchronization of a sharedmap[string][]string
usingsync.Mutex
vs channelsfine-grain
stores the Markov chain in async.Map
, Go's concurrent map implementation