8000 Closing a channel causes GMC synthesis to fail. · Issue #22 · nickng/dingo-hunter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Closing a channel causes GMC synthesis to fail.  #22
Open
@antonis19

Description

@antonis19

In the program below, because of the line where the channel is closed the following happen:

i) GMC synthesis fails.

ii) The global graph constructed ends up being simpler than when the channel is not closed. When the channel is not closed the global graph becomes very complex (contains many diamond and "|" nodes).

package main

func Sender(ch chan <- int, end chan <- bool) {
	ch <-42	
	close(ch)  // <------
	end <- true
}

func Receiver(ch <- chan int, end chan <- bool) {
	<-ch
	end <-true
}

func main() {
	ch := make(chan int)
	end := make(chan bool)
	go Sender(ch,end)
	go Receiver(ch,end)
	<-end
	<-end
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0