Can't go channels send and receive at the same time?

can"t go channel send and receive at the same time

I read the channel send and recv source codes of go 1.11 and found that when sending and receiving, it will be locked first. If I understand it correctly,
both use the same lock. Does this mean that the channel cannot send and receive at the same time. That is, receiving and sending are mutually exclusive?

Go
Jul.05,2022

Yes. It can't. It is a simple circular queue.

A Lock almost solves a large number of concurrency problems, and there are no CAS" operations

Why is it so designed? I think the chan in go is just used for simple communication

.

there is no communication that cannot be solved by one chan, if there is, then two.

Menu