The MASM Forum

General => The Campus => Topic started by: daydreamer on January 30, 2022, 10:28:49 AM

Title: multithreaded ???
Post by: daydreamer 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
Title: Re: multithreaded ???
Post by: HSE on January 30, 2022, 10:59:24 AM
We can imagine that!  :biggrin:
Title: Re: multithreaded ???
Post by: jj2007 on January 30, 2022, 11:36:33 AM
Oh yeah :thumbsup:
Title: Re: multithreaded ???
Post by: daydreamer 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
Title: Re: multithreaded ???
Post by: daydreamer 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?


Title: Re: multithreaded ???
Post by: HSE on February 07, 2022, 11:35:27 PM
Quote from: daydreamer on February 07, 2022, 07:44:51 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 ?  (http://masm32.com/board/index.php?topic=1811.0))
Title: Re: multithreaded ???
Post by: daydreamer on February 08, 2022, 03:21:24 AM
Quote from: HSE on February 07, 2022, 11:35:27 PM
Quote from: daydreamer on February 07, 2022, 07:44:51 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 ?  (http://masm32.com/board/index.php?topic=1811.0))
thanks :thumbsup:
Title: Re: multithreaded ???
Post by: hutch-- 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.
Title: Re: multithreaded ???
Post by: daydreamer on February 08, 2022, 06:46:20 PM
Quote from: hutch-- on February 08, 2022, 04:07:06 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

Title: Re: multithreaded ???
Post by: hutch-- 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.
Title: Re: multithreaded ???
Post by: InfiniteLoop 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.
Title: Re: multithreaded ???
Post by: Caché GB 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.
Title: Re: multithreaded ???
Post by: daydreamer on February 10, 2022, 11:10:16 PM
Quote from: Caché GB on February 09, 2022, 12:05:10 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
Title: Re: multithreaded ???
Post by: daydreamer 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?