News:

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

Main Menu

Threaded IO in an editor

Started by hutch--, October 27, 2020, 02:33:58 PM

Previous topic - Next topic

hutch--

For what is very simple code, you can fully isolate and app that loads and saves files from locking up if the load or save is long. The example creates two suspended threads which are resumed for each operation then suspended in the thread until the next time it is called. Normal Windows messaging is used to notify the main thread when the called thread has suspended its operation.

Note that the editor has no confirmation as I tried to keep it as simple as an editor can be. The sections of code that operate the threads are marked in this format,

            ; ||||||||||||||||||||||||||

              mov lFlag, 1                      ; set the exclusion flag so the button cannot
                                                ; be pressed until the thread finishes
              rcall ResumeThread,lThread

            ; ||||||||||||||||||||||||||

The two threads used are at the bottom of the source code.