wmic cpu get NumberOfLogicalProcessors
: Provides the count of logical processors (cores) available on the Windows system.wmic cpu get NumberOfCores
: Offers the count of physical cores available on the processor.
- Concurrency: The capability of an application to handle multiple tasks or processes simultaneously by interleaving their execution.
- Parallelism: Simultaneous execution of multiple tasks genuinely running at the same time using multiple CPU cores.
"Fork-join" in Go refers to dividing a task into smaller sub-tasks (forking), executing them independently, and then merging the results (joining) to produce the final output.
- Fork: Breaking a task into smaller units for concurrent or parallel execution.
- Join: Merging the results from individual tasks to form the final result.
- Race Conditions: Unpredictable behavior due to multiple threads accessing shared resources without synchronization.
- Deadlocks: Tasks waiting indefinitely for each other, halting progress.
- Livelocks: Continuous state changes without resolution, preventing progress.
- Resource Starvation: Inability to access necessary resources due to monopolization by other tasks.
- Synchronization Overhead: Introduction of synchronization mechanisms impacting performance and complexity.
package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
wg.Wait()
fmt.Println("Wait() executed immediately")
}