[Idea]: Should we write Runtime funcs to use one Goroutine per port?
Closed this issue · 4 comments
Catya3 commented
I will add more to the description when I have time.
Short psuedocode example:
for {
x <- xIn
y <- yIn
res <- x+y
}
var x, y int64
var mu Mutex
go func() { for { /*TryLock Mutex */ x = <- xIn } }
go func() { for { /*TryLock Mutex */ y = <- yIn } }
go func() { for { res <- x+y /*unlock Mutex */ } }
emil14 commented
It depends on logic of specific runtime function
emil14 commented
Also remember that the more locks we have the worse performance is
emil14 commented
I feel like the way to increase performance is actually by reducing amount of goroutines and channels but I have no idea how to do so. Also that's just a feeling, not result of some benchmark