April 23, 2024, 09:51:41 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Using Threads

Started by ckoehn, November 26, 2019, 07:35:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ckoehn

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

Brian

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

ckoehn

November 26, 2019, 10:13:45 AM #2 Last Edit: November 26, 2019, 10:17:18 AM by ckoehn
This is what I have.   :)

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

Later,
Clint

Brian

Well, according to my stats, it should ace yours, but no. Remming out the Sleep made the program zip through, returning nothing!

Brian

ckoehn

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

ckoehn

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