© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
24 replies
NacDan

Iterating over AsyncEnumerable and writing to MemoryStream

Mainly a question on how you all would go about this, I am thinking of just initializing a
SemaphoreSlim(1,1)
SemaphoreSlim(1,1)
and waiting while inside the iteration then writing to the memory stream. Any opposition to this? The compiled code inside an AsyncEnumerable seems to be what I'd expect so I would need some locking while writing to the stream regardless.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ MemoryStream question
C#CC# / help
15mo ago
Converting json to MemoryStream and back breaks the json
C#CC# / help
12mo ago
✅ .csproj – how to generate nodes dynamically by iterating over a string array ?
C#CC# / help
3y ago
✅ Takewhile in foreach iterator exiting without iterating over the elements.
C#CC# / help
3y ago