Created
November 9, 2018 15:47
-
-
Save mamaz/3baa2232f9405a392b2059627b45d7ab to your computer and use it in GitHub Desktop.
Main File for Showing Concurrent vs Parallel
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
package main | |
import ( | |
c "Exercise/ConcurrencyAndParallel/concurrency" | |
p "Exercise/ConcurrencyAndParallel/parallel" | |
"fmt" | |
) | |
// This is a demo for showing concurrency and parallelism works in Golang. | |
// the RunConcurrently() shows how to print a series of numbers and alphabet using single physical processors, | |
// while RunParallel() shows will print them using 2 physical processors. | |
// | |
// Note: more processors doesn't mean it will be faster. | |
func main() { | |
fmt.Println(">>> CONCURRENT") | |
c.RunConcurrently() | |
fmt.Println("") | |
fmt.Println("") | |
fmt.Println(">>>> PARALLEL") | |
p.RunParallel() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment