Skip to content

Instantly share code, notes, and snippets.

@emilisto
Created June 11, 2013 17:15
Show Gist options
  • Save emilisto/5758769 to your computer and use it in GitHub Desktop.
Save emilisto/5758769 to your computer and use it in GitHub Desktop.

Mathias

There are actually two different ways of achieving concurrency in Go:

Nice format:

import (
  "fmt"
)

Buffer size

Go routines:

  • Coroutines

  • Proto-threads

  • Light threads

  • event loops (something about the Plan 9 tool chain)

  • OS threads

Minimalist design, no...

  • operator overloading
  • function overloading
  • replacement of methods
  • altering imported types
  • default params

Nice things about it:

  • good reflection api
  • zero initialized memory
  • local variables aren't
  • multiple function return values
  • no reference implementation

Error handling - apparently pretty controversial

Stefan Nilsson

Two implementations "An amended version of C"

Concureency primitives, the most exciting part.

Notable primitives:

  • Goroutines
  • Channels
  • Select - especially hard to implement

http://www.nada.kth.se/~snilsson/

When end of function is reached, all currently executing threads are killed. Unlike others. Explicitness.

go maxprocs

Usually one doesn't use buffering.

Goroutines provide both synchronization and communication.

IIFE: go function() { // do stuff }()

Specifying the type in variable declaration

var ch <- chan Sushi = Producer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment