Thread Locking

smol84

Client
Регистрация
06.01.2012
Сообщения
30
Благодарностей
2
Баллы
0
ZP crashes when threads/instances try and write to a file or DB at teh same time.

This can be tested by launching over 100 threads and timing them to all execute a write at the same time.

In code creator this is resolved by implementing thread locking - I am surprised that each instance does not lock threads when running because ZP constantly crashes - this is poor coding and should be fixed
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
What action do you use for this?
You have to use "Add to table/list" while it's synced with file on harddrive.
And not "Write to file"
 

smol84

Client
Регистрация
06.01.2012
Сообщения
30
Благодарностей
2
Баллы
0
What are you talking about??? This is code creator, I'm not using the zenno functions I'm using C# to write to a file.. The problem is clearly stated because you do not impose thread locking in your mulithreaded setup
 

darkdiver

Administrator
Команда форума
Регистрация
13.01.2009
Сообщения
2 285
Благодарностей
2 730
Баллы
113
List and Tables are available in Code Creator too
If you are using C# function from System.IO they are not thread safe and we don't response for these functions.
You can use ZennoLab.Macros.FilesSystem class to work with files.
http://help.zennolab.com/en/v4/zennoposter/macros/4.5/webframe.html
Or you can manually create the lock of the static object to synchronize threads.

In any it if something is crashing ZennoPoster please send the logs from the Logs directory.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)