4
I have a system that at certain times uses more than a thousand threads simultaneous and unfortunately accurate run in environment 32-bits.
For default, the Delphi allocates 1kb for each thread new, what, in an environment 32-bits becomes unviable for the size of the system in question.
I could set a new value via menu, but would lose the option to change it at runtime if the new size does not meet my demands or is too big for them.
My intention then is to find a way, using the command Thread.Execute
to parameterize this size. Be via ini, BD or whatever, as long as it’s in the code.
I know with command BeginThread()
would reach my goal, but with it I end up losing several interesting threads functionalities, such as the Thread.Synchronize
and the Thread.Queue
, that, once again, taking into account the size of the project, the weight of these losses becomes enormous.
An example setando via hardcode even would be enough, since I already have the way to parameterize this defined value.
More than a thousand simultaneous threads seems excessive to me. Perhaps it would be better for you to create a Thread-pool, right? What do these threads do?
– EMBarbosa
When you have a queue of almost 70,000 simultaneous commands, a pool of 1,000 doesn’t seem so excessive. I believe everything depends on the referential.
– Filipe.Fonseca
I believe that a lot depends on the referential and so I asked you for more information on the subject without condemning your work. What I do know is that 1,000 simultaneous threads is usually too much if you don’t have a cluster of 500 colors. Without more information it becomes difficult to help because I particularly don’t like to risk on kicks.
– EMBarbosa
My comment was by no means derogatory, @Embarbosa, quite the contrary. By the impossibility of passing more information, I really failed to explain why so many simultaneous threads, so at this point I just made correct my previous error.
– Filipe.Fonseca