onryldz / x-superobject

Delphi Cross Platform Rapid JSON
316 stars 118 forks source link

Thread Safe #95

Closed vianney-allaire closed 8 years ago

vianney-allaire commented 8 years ago

Sorry to contact you again via this method, but I found no other way to do it :

Hello Thank you very for response.

My Superior, has a few more questions regarding XsuperObject and multithreading, just so he feels comfortable continueing using it.

Here is his question (translated as much as I could from french) :

"You are using an object called "JsonLexGrammar" which is inheriting "TLexGrammar ", and instanced as a global object during the unit initialization. We are so thinking that this object is global to all threads, and used by all instances of Object SuperObject created afterwards. However, the object JsonLexGrammar, appears to be making calls (via loads of triggers) to methods which contains no reading (or writing locks), isn't this supposed to be a problem in a multithreading environment ? "

Thanks in advance.

Vianney.

onryldz commented 8 years ago

Hi, Yes JsonLexGrammar is global variable, but just its reading, so there will be no problem for threads.