My bot starts with 50 threads, is there a better way to control the running threads, maybe 20-25 threads run at the same time?
Now I control this with sleep function, 25 threads working for 30 minutes and then sleep for 40 minutes. And when those threads sleeps I run the other 25 threads.
I createa server in Node.js and I want to run this function when it is called, and then do the task asynchronously in a seperate thread and browser and then return the result how can I do this ?
If i write data into a single file using multiple threads then is there any chance of data loss ? Is this method okay to write file or some other method should be used to avoid data loss(if it happens) ?
Thanks
There should be no data loss, but it is still better to use the resource for this purpose