Question:You are creating a method that is part of a custom class. The method might be run simultaneously within multiple threads. You need to ensure that no thread writes to the file while any thread is reading from the file. You want to provide the highest level of efficiency when multiple threads are reading from the file simultaneously. Which code sample should you use? - VB.NET 

A SyncLock file
' Read file
End SyncLock 

B SyncLock
' Read file
End SyncLock 

C Dim rwl As New ReaderWriterLock()
rwl.AcquireReaderLock()
' Read file
rwl.ReleaseReaderLock() 

D Dim rwl As New ReaderWriterLock()
rwl.AcquireReaderLock(10000)
' Read file
rwl.ReleaseReaderLock() 

+ Answer
+ Report
Total Preview: 1243

Copyright © 2024. Powered by Intellect Software Ltd