Hello,
I'm working on a audio program in C# that is writing binary log data to a SD card on a mobile phone.
It is very important that the audio can run without interruptions.
So I was asking myself if the audio processing will wait for the file being written to the card or if there is rather a standard build-in threading for this in C#, .NET? (so that I don't have to make threads myself...)
I also heard that even when working with threads, it wouldn't be faster then without...?
Thanks for any advice!
I'm working on a audio program in C# that is writing binary log data to a SD card on a mobile phone.
It is very important that the audio can run without interruptions.
So I was asking myself if the audio processing will wait for the file being written to the card or if there is rather a standard build-in threading for this in C#, .NET? (so that I don't have to make threads myself...)
I also heard that even when working with threads, it wouldn't be faster then without...?
Thanks for any advice!
Matthew CochranPosted Jan 25, 2008, 4:49 PM
If you are just doing one write operation, it doesn't make sense to build a multi-threaded app because it doesn't seem like you have processes you can run concurrently. However, you may want to use an asynchronous call so you don't block the main thread while your write is occuring.
Here is the first in a series of articles I wrote about async processing: http://www.c-sharpcorner.com/UploadFile/rmcochran/multithreadedasync05112007061031AM/multithreadedasync.aspx?ArticleID=aa830717-7da4-44b2-bc9e-dd98b4f75c6e