Permalink
Browse files

2012-10-12 Open World Forum

  • Loading branch information...
1 parent aa99b50 commit 8afb4009ae90302f3ab8e9eb4d7b3c85c18dd4e6 @nono committed Oct 11, 2012
@@ -1,18 +1,24 @@
-!SLIDE incomplete
-# Conclusion #
-## Goroutines + Channels = <3 ##
+!SLIDE
+# Goroutines + Channels = <3 #
* Ni mutex
* Ni semaphore
* Mais c'est très puissant
!SLIDE
-# Questions ? #
+# Mise en application #
+External images for LinuxFr.org
-* Les slides sont sur [github.com/nono/Presentations](http://github.com/nono/Presentations)
-* Devblog : [dev.af83.com](http://dev.af83.com)
+https://github.com/nono/img-LinuxFr.org
+
+!SLIDE
+# Pour aller plus loin #
+Concurrency is not Parallelism (it's better)&nbsp;— Rob Pike
-## Pour aller plus loin ##
+http://waza.heroku.com/
+
+!SLIDE
+# Questions ? #
+Les slides sont sur [github.com/nono/Presentations](http://github.com/nono/Presentations)
-* Concurrency is not Parallelism (it's better)
-* http://concur.rspace.googlecode.com/hg/talk/concur.html
+Devblog : [dev.af83.com](http://dev.af83.com)
@@ -24,67 +24,3 @@ Concurrence : une question de structure de données
Parallélisme : à propos de l'exécution
![Parallélisme 2](images/gophersimple3.jpg)
-
-!SLIDE
-# Goroutine #
-
-```go
-func computation(n int) {
- time.Sleep(n * time.Milliseconds)
- fmt.Printf("%s seconds elapsed\n", n)
-}
-go computation(3)
-go computation(1)
-go computation(5)
-computation(7)
-```
-
-!SLIDE
-# Channels #
-
-```go
-func pingpong(ch chan int) {
- n := <-ch
- fmt.Printf("Received %d\n", n)
- ch <- n
-}
-
-func main() {
- ch := make(chan int)
- go pingpong(ch)
- ch <- 42
- <-ch
-}
-```
-
-!SLIDE
-# Buffered Channels #
-
-```go
-func pingpong(ch chan int) {
- n := <-ch
- fmt.Printf("Received %d\n", n)
- ch <- n
-}
-
-func main() {
- ch := make(chan int, 5)
- go pingpong(ch)
- ch <- 42
- <-ch
-}
-```
-
-!SLIDE
-# Select #
-
-```go
-select {
- case chan1 <- nb:
- fmt.Printf("c1")
- case str := <-chan2:
- fmt.Printf("c2")
- case str := <-chan3:
- fmt.Printf("c3")
-}
-```
@@ -1,4 +0,0 @@
-!SLIDE incomplete
-# External images for LinuxFr.org #
-
-* https://github.com/nono/img-LinuxFr.org
@@ -8,6 +8,8 @@ blockquote + p:before { content: "— "; }
.gopher p { float: right; }
.gopher pre { clear: both; }
.slide { background-color: #fff; }
+.slide > ul > li:before { content: ""; }
+
#slide1 { border: 0; }
#slide1::before {
content: " ";
@@ -25,3 +27,5 @@ blockquote + p:before { content: "— "; }
#slide1 h1 { top: 20%; }
#slide3 p { width: 50%; }
#slide5 img { margin: 2em 0 0 30%; }
+#slide8 { padding-bottom: 0; }
+#slide8 img { margin: 0 auto; }
@@ -25,11 +25,10 @@ id2 := <-ids
# Timeout #
```go
-timeout := time.After(2 * time.Seconds)
select {
case n := <-ch:
fmt.Printf("Received %d", n)
- case <-timeout
+ case <-time.After(2 * time.Seconds)
fmr.Printf("Too late")
}
```
@@ -39,7 +38,7 @@ select {
# Tickers #
```go
-ticker := time.NewTicker(50 * time.Millisecond)
+ticker := time.NewTicker(50 * time.Millisecond)
go func() {
for t := range ticker.C {
fmt.Println("Tick at", t)
@@ -1,12 +1,12 @@
{
- "title": "Faisons travailler<br/>des gophers ensemble",
+ "title": "Faisons travailler<br/> des gophers ensemble",
"theme": "memories",
"duration": 20,
"sections": {
"intro": "Présentation",
- "concurrency": "La concurrence en Go",
+ "concurrency": "Concurrence et parallélisme",
+ "primitives": "Les primitives de Go",
"patterns": "Quelques patterns",
- "examples": "Mise en application",
"conclusion": "Conclusion"
}
}
@@ -0,0 +1,64 @@
+!SLIDE
+# Goroutine #
+
+```go
+func computation(n int) {
+ time.Sleep(n * time.Milliseconds)
+ fmt.Printf("%s seconds elapsed\n", n)
+}
+go computation(3)
+go computation(1)
+go computation(5)
+computation(7)
+```
+
+!SLIDE
+# Channels #
+
+```go
+func pingpong(ch chan int) {
+ n := <-ch
+ fmt.Printf("Received %d\n", n)
+ ch <- n
+}
+
+func main() {
+ ch := make(chan int)
+ go pingpong(ch)
+ ch <- 42
+ <-ch
+}
+```
+
+!SLIDE
+# Buffered Channels #
+
+```go
+func pingpong(ch chan int) {
+ n := <-ch
+ fmt.Printf("Received %d\n", n)
+ ch <- n
+}
+
+func main() {
+ ch := make(chan int, 5)
+ go pingpong(ch)
+ ch <- 42
+ <-ch
+}
+```
+
+!SLIDE
+# Select #
+
+```go
+select {
+ case chan1 <- nb:
+ fmt.Printf("c1")
+ case str := <-chan2:
+ fmt.Printf("c2")
+ case str := <-chan3:
+ fmt.Printf("c3")
+}
+```
+

0 comments on commit 8afb400

Please sign in to comment.