News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Very fast hex$ (our hobby is beating the CRT)

Started by jj2007, April 17, 2024, 02:06:33 AM

Previous topic - Next topic

zedd151

@sinsi: You're crazy.   :tongue:

I "might" take a look at this later... "maybe" (I'm lazy)

zedd151

Quote from: sinsi on April 19, 2024, 12:29:32 PMIt's a silly idea as far as using it for something so trivial...
Right. That's why you would do as many conversion as possible to justify the overhead... not just one conversion. The overhead might negate any savings otherwise. Would be perfect for a spreadsheet, methinks.

daydreamer

Quote from: sinsi on April 19, 2024, 12:29:32 PMYou could create the threads and leave them suspended, just wake them up to use them then back to sleep.

Quote from: sudoku on April 19, 2024, 12:19:41 PMAre you already experimenting with it?
I'm waiting for someone to tell me "you're crazy" or "hmmm, interesting".
It's a silly idea as far as using it for something so trivial, but there aren't that many practical uses for threads.
Interesting, I tried SIMT using one worker thread adding together very big fibonnaci numbers,while main thread takes care of milliseconds print numbers
So I reduce the print in loop that adds together fibonnaci = reduce the slowest thing that takes Milliseconds, when rest of the loop takes clock cycles
Tried Workerthread in Windows program take and timed it 10 times more clock cycles than with peekmessage method


my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

Quote from: sinsi on April 19, 2024, 12:02:37 PMFaster?

Thread overhead is far too high for individual numbers. However, if you have a gigabyte to convert, splitting the task will certainly be faster.

sinsi

Create the threads beforehand (like making a lookup table, once is enough).
Each thread suspends itself after the calculation by setting a bit to say "I've finished" and SuspendThread.
The thread waits for the next job via ResumeThread.

A more realistic use might be to fill a huge block of memory?

jj2007

Quote from: sinsi on April 19, 2024, 06:11:37 PMA more realistic use might be to fill a huge block of memory?

Yes indeed. And each thread working on "its" slots, i.e.
thread #1 working on start+16*n+0
thread #2 working on start+16*n+4
thread #3 working on start+16*n+8
thread #4 working on start+16*n+12

That would ensure good usage of the L1 cache while keeping busy a significant share of the CPU. I wonder, though, about cache misses if one thread lags behind. That is, if there can be a significant speed difference.

daydreamer

I would like to start a new thread for SIMT exercises + timings
Sleep in main thread suggest cpu switches to another thread after starting x number of threads
Program Decides # threads after check cpu # of cores?, because we have very different cpu's with different # of cores
I am curious if Createthread directly start execution with set custom bigger stack space to use local arrays vs several invokes
Invoke Createthread suspended
Invoke alloc memory
Invoke start thread?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

zedd151

Quote from: daydreamer on April 20, 2024, 12:15:06 AMI would like to start a new thread for SIMT exercises + timings
Sleep in main thread suggest cpu switches to another thread after starting x number of threads
Program Decides # threads after check cpu # of cores?, because we have very different cpu's with different # of cores
Post some code and we'll test it, Magnus...
We're always up for a new speed test/challenge...