How to make dynamic threads (based on date/time)

Matzedoon

Пользователь
Регистрация
16.12.2016
Сообщения
32
Благодарностей
1
Баллы
8
How can I schedule a dynamic threads count
My template runs on views of website, it's unnatural to have one static thread of number.. like 10 threads would result always same amount of views on site.


how can I schedule a dynamic thread count?

Like I want on monday from 08:00-12:00 to be between 4-10 threads.
monday from 12:00-18:00 to be between 15-18 threads

Is this possible? per hour? per day?
 

KitKat21

Client
Регистрация
02.05.2017
Сообщения
263
Благодарностей
191
Баллы
43
I wish they had random schedulers.

The workaround I found is to add a logic pause at the start of your project and then when you schedule threads to run say every 1hour, it won't always be on the hour since you have a random pause at the start.
So if random pause is between 1 second and 1000 seconds, sometimes it will run at 3:01 sometimes at 3:14 etc.
 

Yann

Client
Регистрация
22.04.2017
Сообщения
207
Благодарностей
30
Баллы
28
Yes the pause at the start of the script helps to make it look more random and not always the same.
You could do what you are looking for with c# but if you're not a programmer, a simple work around could be to prepare a text file with a list and you can use whatever logic you want.
For instance you could have a different file for each day of the week and inside each file a list of 0s and 1s.
Each thread is taking one line from the file, if it is a 1 it executes the rest of the script, if it is a 0 it stops.

Therefore depending on the number of 1s you sort of control the number of thread in a very simple way depending on the day of the week.
You could also extend that logic with a "2" in the list which could mean a pause at start to delay those threads...and so on...

Hope that helps :-)
 

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