You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
900+ threads created (only 1 per cpu expected nominally)
PostMessage related QUOTA errors (so, threads likely not getting enough time)
What seemed to be the problem was that threads were leaking from using code like:
bool:=Parallel.Future<boolean>(
function(): boolean
begin
Parallel.ForEach<Integer>( list ).NumTasks( System.CPUCount ).Execute( delegate );
result:=true;
end );
while not bool.IsDone do
begin
Sleep(100);
{ update animated spinner }
end;
In the end we eliminated the leak by removing the Future all-together, ie hoisting the ForEach up into the main thread, but we lose out on our nice spinner (for now).
Might it be possible that we could prevent the problem and use:
threadgroup:=Parallel.ForEach<Integer>( list ).NumTasks( System.CPUCount );
to create a context to hold the thread references (and allow the other compiler machinery to destroy them) and then use threadgroup inside the Future?
Alternatively, perhaps we will switch to a threadpool.
The text was updated successfully, but these errors were encountered:
See issue #194.
The memory is not leaking, but it seems that the memory has not been released immediately, and repeated calls can lead to memory depletion
Symptoms:
What seemed to be the problem was that threads were leaking from using code like:
In the end we eliminated the leak by removing the Future all-together, ie hoisting the ForEach up into the main thread, but we lose out on our nice spinner (for now).
Might it be possible that we could prevent the problem and use:
to create a context to hold the thread references (and allow the other compiler machinery to destroy them) and then use
threadgroup
inside the Future?Alternatively, perhaps we will switch to a threadpool.
The text was updated successfully, but these errors were encountered: