IonicWind Software

IWBasic => General Questions => Topic started by: ckoehn on November 26, 2019, 07:35:18 AM

Title: Using Threads
Post by: ckoehn on November 26, 2019, 07:35:18 AM
I don't know if this is a question and yet it is.  Is something like this thread safe?  If you have a lot of data to crunch it looks like it makes a difference.

This was with 1 ms between totals to show that threading worked.

This was run on my quad core laptop.

Later,
Clint
Title: Re: Using Threads
Post by: Brian on November 26, 2019, 08:33:16 AM
Clint,

That must be a seriously fast laptop! I managed 130.something for the single thread, and 30.something for four threads. I'm running an i5 with four cores and four threads

Methinks update CPU time!

Brian
Title: Re: Using Threads
Post by: ckoehn on November 26, 2019, 10:13:45 AM
This is what I have.   :)

You could remove that 1 ms delay in the SUB and see how that works for you.

Later,
Clint
Title: Re: Using Threads
Post by: Brian on November 26, 2019, 11:21:51 AM
Well, according to my stats, it should ace yours, but no. Remming out the Sleep made the program zip through, returning nothing!

Brian
Title: Re: Using Threads
Post by: ckoehn on November 26, 2019, 11:29:07 AM
I have no idea why this laptop is that fast.  I tried it on my desktop that I thought was fast and it showed 18.75 secs for one thread and 4.97 secs for 4.  It probably depends on what other processes you have running in the background.  Maybe someone who is in the know can tell us.

Later
Clint
Title: Re: Using Threads
Post by: ckoehn on November 27, 2019, 03:51:46 PM
Brian,

I think I found out what the difference is.  My laptop is a Windows 7, yours and my other computer is a Windows 10.  ::)

Later,
Clint