TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: all
from: Erik Huelsmann
date: 1996-02-04 15:45:20
subject: Secondary thread / Guard-page excep

Hello all!

Writing an application under WARP (using SpeedPascal/2), I decided to
incorporate a secondary thread for some lengthy generation-operations that
were only in very rare cases _not_ to violate the 1/10th rule.

I did not incorporate this at first, since I had trouble enough writing for
PM as it is.

My problem is this: I start the thread with a stack of some size (tried
different sizes). 
Then the thread-function calls some routines local to the application.
Nothing wrong yet, but as soon as I want to initialise the thread to open
an Object window, using WinInitialize, I get a Guardpage exception. (I
tried sizes: $4000,32768,81*1024*1024)

I did not install an exception handler for this secondary thread, but the
compiler's runtime-library does not seem to install one for the main thread
and does not seem to have any problems in stack-expansion.... 

Who can help me solve this problem? (or has had any problem like it?)

I could write an exception-handler that uses the guardpage-system to expand
the stack, but the operating system is supposed to be able to do that
itself...

Bye, Erik!
[TeamOS/2 NL]
preferred personal reactions through e-mail
[internet: ErikH{at}hcc-gron.idn.nl]

PS: I did try to run the thread using the Commit-stack option. This does
the trick, but I don't want to be placed back into the 16-bit age where I
need to try to determine the max. size my stack will grow to.

--- FleetStreet 1.14 NR
* Origin: ORIGINal messages, I like them (2:500/19.1929)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 500/19 9 28/777 2/777 396/1 270/101 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™.