CCriticalSection and array elements
If say, I have an array of CStrings which is being accessed by two threads, is it possible to lock individual elements of that array?
The idea being not to lock up the entire array.
If this is possible, could someone post a simple example?
Many thanks
DJ
Re: CCriticalSection and array elements
Yes, if you can control how access is gained to the array.
One way would be to build your own array class and aggregate or privately
derive from an exisiting array class. Then in your classes [], getElementAt(),
or whatever method, insert your critical section. It really depends on how fancy you want to get;-)