ThinkGeo.com    |     Documentation    |     Premium Support

ReadLock and WriteLock

This is sort of a silly question, but if I am doing both read and writes to an overlay do I need to use both or does the WriteLock include a sort of readlock as well?


 


Thanks.



I also has this problem, do you test them? 
 I guess WriteLock and ReadLock don’t have any include relationship. 
 If you read overlay, just need readlock 
 if you write overlay, just need writelock. 
 I test them, it works.

I have not tried to create a situation where I am accessing a resource currently in either of those locks, but just wanted to make sure seeing as how I can also make a lot of these edits without using any locks at all. I just wanted to be sure I was doing it correctly. Thanks for sharing your experience on it, James.

Thanks for your sharing experience, James! 
  
 Nelson, 
  
 The Read/Write lock is designed to solve the threading problems and in our system we will use another threading to draw to enhance the UI response if you did not change the ThreadingMode back to SingleThreaded. 
  
 So we   suggested you use the lock system when read and write Overlay as James said. 
  
 For more information just takes a look at the video as following: 
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/5798/afv/topic/Default.aspx 
  
  
 Any more questions just let me know. 
  
 Thanks 
  
 Yale 
  


I realize why the locks are in place. I was simply wondering if does both Get and Set properties of an overlay in one operation, would I need to then enter a ReadLock as well as a WriteLock or just a WriteLock. 
  
 Thanks.

Nelson, 
  
 Ideally you need the ReadLock wheneven you read data from Overlay, but if you ONLY develop App without another threading involved, this can be ignored, it will rarely cause problem.  
 But when you develop App with multiple threading involved, it is probably need ReadLock as well. 
  
 Any more questions or if I am not clear enough just let me know. 
  
 Thanks. 
  
 Yale 


Thank you, Yale. Very clear!

Yale is a good Guy. Congratulation to you have been promoted to MVP. 
 Glory be to Yale!

Thanks Nelson and James! 
  
 Any other problems just let me know. 
  
 Thanks. 
  
 Yale