python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
What does a select statement with just a case clause (without case expression) and default case do in Golang?
I have trouble understanding the following excerpt of code. The run() f-n is executed as a goroutine and I think is responsible for dispatching all entries in the 'gloabl' broadcast channel to the cor...
CapBul
Votes: 0
Answers: 1
How can I send a hashmap over a channel?
I want to send a hashmap over a channel:
use std::collections::HashMap;
use std::sync::mpsc;
use std::thread;
pub fn frequency(input: &[&str]) {
let handles = vec![];
let (tx, rx) = m...
hkBst
Votes: 0
Answers: 0
Unable to read from close unbuffered channel
I know we can read from buffered close channels. So, I feel very confident that we can do from unbuffered as well. However, I am not able to test it out.
func test(c chan int) {
time.Sleep(10 * ti...
Tanmay Jha
Votes: 0
Answers: 1
How this select statement executes?
incoming := make(chan int)
done := make(chan struct{})
...
close(done)
...
select {
case incoming <- order:
// logic
case <-done:
return
}
Let's say you close th...
Robert Mihai
Votes: 0
Answers: 1