View Single Post
  #127  
Old 10.12.2020, 09:59
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,635
Default

Quote:
Originally Posted by mgpai View Post
I will optimize these scripts, but, I do not want to use global properties in new scripts, if it needs additional code to handle collision. It doesn't really make sense having to repeat the same code every time we need to read/write them. I think that should be the default behavior for global properties, or at least there should be a flag/switch to make it so.
Contact me by mail and I will explain. You have to synchronize read/write when dealing with shared variables/information. You have to make sure that changes are visible to all other scripts/executions as well. Instead of slow read/write to disk which was synchronized as well, you now have to synchronize the access in the script.
Your modified script reads file from disk once and then continue to use highspeed in memory list. The other scripts however still read/write from disk and thus the changes are not visible to the in memory list.
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 10.12.2020 at 10:01.
Reply With Quote