TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Jonathan de Boyne Pollard
date: 1995-08-18 09:44:48
subject: setjmp, longjmp, pm

PE>
  > Does anyone know if any OS/2 compilers support setjmp and
  > longjmp in a PM program?
PE>

  All OS/2 C compilers support setjmp/longjmp, irrespective of whether
  the target is a text-mode or a PM program.

  On the other hand, in most cases that setjmp/longjmp are required you
  will often find Poor Man's Threading(tm) in operation. Since all OS/2
  C compilers support *real* threads, this is largely unnecessary.

  For example, a text-mode VIO program could be ported to a PM program
  by simply spinning off a PM message queue thread, and creating a
  standard window with an AVIO presentation space in its client area.
  The rest of the program would simply need to write to the handle of
  the AVIO presentation space in the VioXXXX() calls instead of to 0.

  For another example, a text-mode "glass TTY" program could be ported
  to a PM program by spinning off a PM message queue thread, creating a
  standard window with an MLE client, and redirecting standard input and
  output through a bidirectional pipe.  The main message queue thread
  would send all WM_CHAR messages received by the MLE over the pipe to
  standard input, and a further (message queue) thread should sit
  reading the pipe from standard output and sending all output to the
  MLE, scrolling as necessary.

  Of course, these are by no means optimal solutions (the best solution,
  after all, is to reimplement the program in proper event-driven
  fashion), but they don't involve anything really much more complex
  than basic pipes, threading, and window creation.

  > JdeBP <
___
 X MegaMail 2.10 #0:

--- Maximus/2 3.00
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 440/4 141/209 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.