Author Topic: multithreaded ???  (Read 1435 times)

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
multithreaded ???
« on: January 30, 2022, 10:28:49 AM »
Hi
I am trying to make a multithreaded program,that is suppose to make use of producer(workerthread)/consumer(mainthread) algo
also something is wrong when console exits it hangs
my none asm creations
http://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."

HSE

  • Member
  • *****
  • Posts: 2258
  • AMD 7-32 / i3 10-64
Re: multithreaded ???
« Reply #1 on: January 30, 2022, 10:59:24 AM »
We can imagine that!  :biggrin:
Equations in Assembly: SmplMath

jj2007

  • Member
  • *****
  • Posts: 13302
  • Assembly is fun ;-)
    • MasmBasic
Re: multithreaded ???
« Reply #2 on: January 30, 2022, 11:36:33 AM »
Oh yeah :thumbsup:

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #3 on: January 31, 2022, 02:11:20 AM »
new version
dont know how fast a workerthread will go on other cpus and how much change threadpriority will do on performance?
its meant to use many registers,taken advantage of workerthread without api calls can use all registers,whats why I want to unroll it

seem to get calculation right,also solved printing crap with use extra variables for output
tricky not be able to use other instructions that affect flags while adding BCD's
« Last Edit: February 08, 2022, 11:44:26 PM by daydreamer »
my none asm creations
http://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."

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #4 on: February 07, 2022, 07:44:51 PM »
On Win10 ustr$ seem to work,but on win8 computer it calls signed integer conversion? While I try a fast get only first 20 digits of f(2^32)?
Call long 64 bit conversion instead?


my none asm creations
http://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."

HSE

  • Member
  • *****
  • Posts: 2258
  • AMD 7-32 / i3 10-64
Re: multithreaded ???
« Reply #5 on: February 07, 2022, 11:35:27 PM »
On Win10 ustr$ seem to work,but on win8 computer it calls signed integer conversion?

Is an old MASM32 version? (See Topic: ustr$ Problem ? )
Equations in Assembly: SmplMath

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #6 on: February 08, 2022, 03:21:24 AM »
On Win10 ustr$ seem to work,but on win8 computer it calls signed integer conversion?

Is an old MASM32 version? (See Topic: ustr$ Problem ? )
thanks :thumbsup:
my none asm creations
http://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."

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10005
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: multithreaded ???
« Reply #7 on: February 08, 2022, 04:07:06 PM »
Magnus,

You are doing to have to stop daydreaming about well know technology, if you can master thread technology in either 32 or 64 bit Windows you will have arrived at one of the most powerful techniques for dealing with data, graphics or functionality.

Try a few of these, the executable that starts is the MASTER process or the MAIN process and from that process you can start one or more threads to do any of a multitude of things. You can start a thread as soon as its created OR you can start it suspended and restart it later.

You learn how to use CreateThread() and any of the supporting functions, write the code then test it to make sure it works correctly.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #8 on: February 08, 2022, 06:46:20 PM »
Try a few of these, the executable that starts is the MASTER process or the MAIN process and from that process you can start one or more threads to do any of a multitude of things. You can start a thread as soon as its created OR you can start it suspended and restart it later.

You learn how to use CreateThread() and any of the supporting functions, write the code then test it to make sure it works correctly.
I can add thread that uses formula ( ( (1+sqrt(5))/2 )^n - ( (1-sqrt(5))/2 )^n )/sqrt(5)
thread that saves and load
but this was learned from tutorial producerthread sends messages/consumer thread recieves messages combined with fibonnaci when I found out printing took seconds,while calculation takes cycles

my none asm creations
http://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."

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10005
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: multithreaded ???
« Reply #9 on: February 08, 2022, 08:15:15 PM »
Magnus,

I don't like to be hard on you but you are talking nonsense here. Thread creation is using Windows API functions with other API functions to assist and/or manipulate threads. Posting mathematical notation is simply a nonsense, you create threads first and if you have some number crunching to do, you do it IN THE THREAD.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

InfiniteLoop

  • Regular Member
  • *
  • Posts: 34
Re: multithreaded ???
« Reply #10 on: February 09, 2022, 10:56:40 AM »
That expression seems awfully familiar.
Fibonacci sequence?
Yes it is. edit: I didn't even notice its already mentioned.

Caché GB

  • Member
  • **
  • Posts: 108
  • MASM IS HOT
Re: multithreaded ???
« Reply #11 on: February 09, 2022, 12:05:10 PM »
Hi daydreamer

Iczelion's Tutorials:-

Tutorial 14: Process
Tutorial 15: Multithreading Programming
Tutorial 16: Event Object

will show you how it's done.
Caché GB's 1 and 0-nly language:MASM

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #12 on: February 10, 2022, 11:10:16 PM »
Iczelion's Tutorials:-

Tutorial 14: Process
Tutorial 15: Multithreading Programming
Tutorial 16: Event Object

will show you how it's done.
Thanks  :thumbsup:
Probably also fix on win8 it exits with popup that it won't work properly
@infiniteloop
Yes it's fibonnaci, that I want to improve with SIMT
my none asm creations
http://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."

daydreamer

  • Member
  • *****
  • Posts: 2198
  • my kind of REAL10 Blonde
Re: multithreaded ???
« Reply #13 on: February 19, 2022, 05:56:43 AM »
I gone thru tutorials
can I  SendMessage zero terminated ascii directly from one of the Workerthreads? To a windows gui control?


my none asm creations
http://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."