What Exactly Is "Bind to File" or a List?

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
Is "Bind to File" =
Load txt content to List + Save all future list processing to file
or
Load txt content to List only BUT NOT save all future list processing to file
?

Thanks.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
It depends on list's settings. if you have there checkboxed "load from file" + "save changes" it will do it.
 

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
If Neither "Load from file" nor "save Changes" is checked in list Setting,
what will "Bind to file do?

Is it
Load txt content to List + Save All future processing list to file
or
txt Load content to List Only BUT NOT save All future processing list to file
?

Thanks.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Second option. And keep in mind if you dont sync list changes with file it will require additional RAM for each thread since each thread will operate with separate copy of file in memory.
 
  • Спасибо
Реакции: huangxiangcai_old

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
Second option. And keep in mind if you dont sync list changes with file it will require additional RAM for each thread since each thread will operate with separate copy of file in memory.
Two questions.

1. I use bind to file because I need to use variable in the file name. It has created a huge memory problem for me even in an one thread project where the file is binded and saved (through list processing) multiple times in a loop.
In this case, how can I "sync list changes with file"? The list setting does not take variable in file name.

What is the best solution for this? The memory usage is going above the max.

2.
Now each thread is binding a different file to that same list name. How to avoid the conflict between threads for that list? Is there a way to make a list to have a local copy for each thread, so that each thread has different content in the list?

Thanks.
 
Последнее редактирование:

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
I was editing the above post and 30mins expired. The following is a clearer version of the question:


My project has 20 threads. Each thread logs in with one of my 20 usernames and saves new tweets to username-content.text every hour in an infinite loop.

Now the memory usage is going through the roof, and I am looking for the best solution.

Two questions first:

1.
I use bind to file because I need to use variable (the username) in the file name. It has created a huge memory problem for me because for each user, the file is binded and saved (through list processing) multiple times in a loop.
You said "sync list changes with file" can reduce memory use, but how can I do that in this case? The list setting does not take variable in file name.


2.
Now each thread is binding a different file to that same list name. Will there be any conflicts between threads for that list? i.e one thread is reading the list content which another thread binds to.
Is there a way to make the list have a local copy for each thread, so that each thread operates on different content in the list to avoid this conflict?

If not, then what is the best solution for my goal?

Thanks a lot!
 
Последнее редактирование:

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
I have applied "reset instance" and memory usage is now lower. But still, please answer the above two questions. Thanks.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
You said "sync list changes with file" can reduce memory use, but how can I do that in this case? The list setting does not take variable in file name.
I said this about memory optimising when you use the same list for all threads )
In this case you just mark "Load from file" and "save changes"
Otherwise each thread will use it's own version of list in memory

Now each thread is binding a different file to that same list name. Will there be any conflicts between threads for that list?
No.

If you create projects which work long time, use restart instance action regularly
 

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
I said this about memory optimising when you use the same list for all threads )
In this case you just mark "Load from file" and "save changes"
Otherwise each thread will use it's own version of list in memory
Sorry. it's not clear here.
If I have marked "Load from file" and "save changes", this makes "use the same list for all threads", will this cause the conflict between threads? I mean my threads are using the same list name, but have different contents for that list name.
Thanks.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

Cyrix

Client
Регистрация
16.12.2011
Сообщения
390
Благодарностей
11
Баллы
18
I found that if I once checked "load from file" and "save to file" in list settings, then bind to the file, even if later I uncheck those two settings and rerun the template, changes in the list are still written to the file (at least in PM). Bug?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Couldnt reproduce. Record screencast or something. Cannot confirm any bug here.
 

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