Last active
April 25, 2017 19:48
-
-
Save ChrisCates/fa7603d7b7a70cc13cb6e2dfb07e5324 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileList := make(chan string, len(files)) | |
| done := make(chan int, availableCores) | |
| for i := 0; i < availableCores; i++ { | |
| go threadedRead(i, columns, fileList, done) | |
| } | |
| for i := 0; i < len(files); i++ { | |
| fileList <- "sql_tmp/" + files[i].Name() | |
| } | |
| close(fileList) | |
| for i := 0; i < len(files); i++ { | |
| fmt.Println("Chunk #", i, "read") | |
| <-done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment