Page 1 of 1

How Many Threads at the same time ?

Posted: Sat Aug 07, 2021 9:11 am
by thyphoon
Hello,

How do I know how many Threads I can run at the same time to load images? is there a calculation according to the processor (number of cores)? Are there any limits?
thanks

Re: How Many Threads at the same time ?

Posted: Sat Aug 07, 2021 9:20 am
by Bitblazer

Re: How Many Threads at the same time ?

Posted: Sat Aug 07, 2021 3:37 pm
by thyphoon
Thanks i will read it !

Re: How Many Threads at the same time ?

Posted: Sat Aug 07, 2021 8:17 pm
by STARGÅTE
The limit is reached, when CreateThread() returns #False:

Code: Select all

Procedure Test(Void.i)
	Repeat
		Delay(1000)
	ForEver
EndProcedure

Define Count = 0
While CreateThread(@Test(), Count)
	Count + 1
	If Count % 100 = 0
		Debug Count
	EndIf
Wend
Debug Str(Count) + " threads!"
On my system no limit is reached, but thread creation becomes slower (count around 40000).

Re: How Many Threads at the same time ?

Posted: Sun Aug 08, 2021 12:34 am
by Bitblazer
STARGÅTE wrote: Sat Aug 07, 2021 8:17 pmOn my system no limit is reached, but thread creation becomes slower (count around 40000).
Sounds like virtual memory mapping kicking in?

Re: How Many Threads at the same time ?

Posted: Sun Aug 08, 2021 6:37 am
by thyphoon
ok thanks ! :mrgreen:

Re: How Many Threads at the same time ?

Posted: Sun Aug 08, 2021 8:40 am
by helpy