1. 3
  1.  

  2. 1

    Very interesting, but I think I may be more confused after reading it than I was before. The difference between parallel and concurrent was almost like this is this and that is that. If there’s a bright line between the two, I missed it.

    I will quibble with the claim that one cannot hope to detect race conditions without knowing what the program is trying to do (kid opens box, goes pee, comes back example). It’s actually fairly easy to detect that a result computed in one critical section is flowing into a different critical section.

    1. 1

      It’s actually fairly easy to detect that a result computed in one critical section is flowing into a different critical section.

      Go’s race detector does exactly this (example on a quick test program I wrote):

      ==================
      WARNING: DATA RACE
      Read by goroutine 5:
        main.readMessages()
            /Users/kyle/tmp/scratch/foo.go:25  0xe4
        gosched0()
            /Users/kyle/src/go/src/pkg/runtime/proc.c:1218  0x9f
      
      Previous write by goroutine 4:
        main.setMessages()
            /Users/kyle/tmp/scratch/foo.go:16  0xe5
        gosched0()
            /Users/kyle/src/go/src/pkg/runtime/proc.c:1218  0x9f
      
      Goroutine 5 (running) created at:
        main.main()
            /Users/kyle/tmp/scratch/foo.go:33  0x89
        runtime.main()
            /Users/kyle/src/go/src/pkg/runtime/proc.c:182  0x91
      
      Goroutine 4 (running) created at:
        main.main()
            /Users/kyle/tmp/scratch/foo.go:32  0x72
        runtime.main()
            /Users/kyle/src/go/src/pkg/runtime/proc.c:182  0x91
      
      ==================
      
      1. 1

        Hmm, having mulled this over a bit more, I’d have liked to see some discussion of sequential. If there’s one line of kids for a pile of gifts, that seems sequential to me. How, if at all, does sequential relate to concurrent. Or is it only the opposite of parallel and unrelated to concurrent?

        The more I think about the labelled gifts, the less I like it. Who put the labels on the gifts? Who kept the unruly kids out of the room while the labeling was done? It does look a lot nicer, but it seems he pushed a lot of the hard work off screen.