The scenario:
I have a file writer that is accessed by many processes/threads, so I have to implement a queue for lines in case the file is locked. So I also have a thread that watches over the contents of the queue, and writes to disk at the first available chance.
To save performance, I Suspend() the thread when no items are in the queue, and Resume() when there are.
However, Suspend() is deprecated, and the suggestions are Mutex, Monitor, Semaphore or Event.
Which should I use?
TIA.
I have a file writer that is accessed by many processes/threads, so I have to implement a queue for lines in case the file is locked. So I also have a thread that watches over the contents of the queue, and writes to disk at the first available chance.
To save performance, I Suspend() the thread when no items are in the queue, and Resume() when there are.
However, Suspend() is deprecated, and the suggestions are Mutex, Monitor, Semaphore or Event.
Which should I use?
TIA.