delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/05/20/06:17:48

From: vtailor AT gte DOT net
Subject: Threadbare threads using WM_FORK message?
20 May 1998 06:17:48 -0700 :
Message-ID: <199805191325.IAA04439.cygnus.gnu-win32@smtp2.mailsrvcs.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com
Cc: vtailor AT gte DOT net

One way to implement a thread in more recent versions of Windows
is to use SendMessage to initiate that thread.  You define a
WM_USER message called WM_THREAD, then subclass the main window
to include a WM_THREAD case.  The LPARAM of SendMessage then carries
a two-element structure containing the entry point of the thread
function and its parameter list.

Waiting for the thread to complete then involves testing for some
completion criterion while performing a PeekMessage loop.  This, of
course relies on the alleged pre-emptive multitasking of recent
Windows releases.

This won't work in the Microsoft console window, because of imposed
limitations, but any emulation of such a text window would work.
Œ
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019