Re:Memory usage of a toy C# server and client with 500K conc...
by tapirl on Saturday January 26, 2019 @08:24PM
(#19009809)
Does it support select? Almost half of concurrrent programming use cases in Go are select related.
[ Parent
| on HN ]
Re:Memory usage of a toy C# server and client with 500K conc...
by benaadams on Saturday January 26, 2019 @09:02PM
(#19009955)
Yeah, at a guess you'd combine the multiple `WaitToReadAsync` with `await Task.WhenAny`; then use `TryRead` to run though the bunch of channels in a non-blocking way.
Could even use the return `await Task.WhenAny` to tell you the specific one to check. Shouldn't be a very hard construct to make; to make it more select like.
Re:Memory usage of a toy C# server and client with 500K conc...
by tapirl on Saturday January 26, 2019 @09:46PM
(#19010093)
good. It looks it is much like the reflect.Select (https://golang.org/pkg/reflect/#Select) in Go.
It has the benefit that any number of tasks can be selected, but the efficiency is not good as hard-coded select blocks.
But it looks C# Task.WhenAny has much less use case variants than Go select block.