Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use System.Threading.Channels.

BoundedChannelFullMode.DropNewest, DropOldest, DropWrite, Wait specifies the behavior to use when writing to a bounded channel that is already full



Thank you! I didn't know that existed. I gotta test the performance of that compared to something like a list or array with an explicit lock, which is otherwise my go to solution precisely for performance reasons.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: