How to write multiple lines in a table, all at once (multithreaded project)?

Aronax

Client
Регистрация
29.01.2015
Сообщения
201
Благодарностей
59
Баллы
28
Hi Guys,

Do you have any simple solution for this situation?

I have a template which will run on multiple threads.
At the end of each iteration, the template will need to save several lines in an excel file. If running on a single thread there would be no problem, but when running on multiple threads I am afraid that the results will be mixed up.

This is how I want the results to be saved in the excel file:

Line 1 Thread 1
Line 2 Thread 1
Line 3 Thread 1
Line 1 Thread 2
Line 2 Thread 2
Line 3 Thread 2
...

What I mean is that I would like all the results from Thread 1 to be saved all at once in the excel file, and not mixed up with some/ all of the results of Thread 2

This is how I do not want the results to be saved in the excel file:

Line 1 Thread 1
Line 1 Thread 2
Line 2 Thread 2

Line 2 Thread 1
Line 3 Thread 1
...
I think you got my point...

Thabks a lot for your help!
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43
Give each thread a random unique ID (or a counter).
Say thread 1 = 111 and thread 2 = 222.

The table would look something like:
Sex, Age, ID
Male, 18, 222
Female, 22, 111
Female, 25, 222
Male, 20, 111

Then chose to sort the table by the column called ID (added in v5.9.7.1) and it would result in something like:
Female, 22, 111
Male, 20, 111
Male, 18, 222
Female, 25, 222
 
  • Спасибо
Реакции: Aronax

Aronax

Client
Регистрация
29.01.2015
Сообщения
201
Благодарностей
59
Баллы
28
Sounds great. Thanks a lot!
 

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