
                  OS/2 Programming                 (Fidonet)

                 Saturday, 28-Aug-1999 to Friday, 03-Sep-1999

+----------------------------------------------------------------------------+

From: Thomas Seeling                                    26-Aug-99 09:37:13
  To: David Noon                                        28-Aug-99 01:59:15
Subj: ... Perl

Hallo David,

Am 24 Aug 99 um 00:00 schrieb David Noon an andrew graham:

 DN> However, Perl under OS/2 is just fine here. I've had it running for a few
 DN> years now.

[quote]

Message-ID: <5ouse9$7mk@news1.sol.no>
References: <slrn5qvn91.8o.lmb@pointer.teuto.de>
<5oru47$75v@huitzilo.tezcat.com> <5orvb6$en3@bonkers.taronga.com>
<slrn5r59m0.8o.lmb@pointer.teuto.de> <5ouma3$1li$1@bofh.noc.best.net>

In article <5ouma3$1li$1@bofh.noc.best.net>, rone@bofh.noc.best.net (Ron
Echeverri) writes:
> Funny how there's no Obfuscated Perl contest (or is there?).

There sure is, the first winner was a cow-orker of mine who submitted this:

*_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^F
*$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$&&print time


Tschau...Thomas

--- GEDW32 3.0.1
 * Origin: Die TeX-Box: +49-6036-980114 V.34/X.75 24h (2:2461/332.42)
278/111
724/10

+----------------------------------------------------------------------------+

From: Eddy Thilleman                                    28-Aug-99 10:16:12
  To: Jonathan de Boyne Pollard                         28-Aug-99 21:46:02
Subj: Terminating threads clean

Hi Jonathan,

25 Aug 99, Jonathan de Boyne Pollard of 2:257/609.3 wrote to Eddy Thilleman:

JdBP> A critical section in 32-bit OS/2 causes all other threads
JdBP> in the same process to be blocked, so that they cannot be
JdBP> scheduled to run.

Thanks.

  Cheers   -=Eddy=-        email: eddy.thilleman@net.hcc.nl

... "I don't handle... delicacy very well." -- Odo
--- MBM v4.14
 * Origin: Mijn allernieuwste origin! (2:500/143.7)
104

+----------------------------------------------------------------------------+

From: Eddy Thilleman                                    28-Aug-99 11:57:20
  To: andrew graham                                     28-Aug-99 21:46:02
Subj: DosSetPriority

Hi andrew,

23 Aug 99, andrew graham of 1:250/520 wrote to Eddy Thilleman:

ag> Not a safe assumption on your part. This machine is a
ag> 386sx20 with 8 megs of ram running FD/2 under MShell, and no
ag> working CDROM drive. :(

I didn't know that. :)  And OS/2 is installed from floppies?

ag> So I guess if it were on topic, which it's probably not, my
ag> next question would be: How?

What about going to a system with a cdrom drive and split it there on multiple 
floppies (with an archiving tool like pkzip, rar) and put them on your above
system? 

Or, if you have a serial "nul modem" cable or a parallel cable with
send/receive cross wired you can connect both systems and send the inf files
over the cable.

Don't say it's not possible, certainly you have OS/2 on that system.

  Cheers   -=Eddy=-        email: eddy.thilleman@net.hcc.nl

... ERROR #0001: COSMOS.CFG Corrupt. Reboot Universe (Y/N):
--- MBM v4.14
 * Origin: Iedere ontmoeting is het begin van een afscheid. (2:500/143.7)
104

+----------------------------------------------------------------------------+

From: Herbert Rosenau                                   28-Aug-99 10:19:13
  To: Eddy Thilleman                                    28-Aug-99 21:46:02
Subj: Terminating threads clean

MR>> Those are for making sure something is finished without being
MR>> interrupted by signals or exceptions.

MR>> The functions DosEnterCritSec() and DosExitCritSec() are
MR>> intended for making sure the current thread completes before
MR>> all others in the same process (by setting it at a higher
MR>> priority).

 ET> I thought that was by preventing being interrupted, not by
 ET> setting it at a 
 ET> higher priority?

No. DosEnterCritSec does not more than blocking all other threads of the same
process. Other Threads of other processes can and will become CPU after
timslice of the running thread is over.

Most (but not all) OS/2 APIs calls DosExitCritSec() under cover. So you should 
not use any API (system, runtime, library) unless you know that this function
would never call a system API.

--- Sqed/32 1.14/development
 * Origin: Schont die Umwelt: Vermeidet DOSen (2:2476/493)
104

+----------------------------------------------------------------------------+

From: Herbert Rosenau                                   28-Aug-99 10:20:08
  To: andrew graham                                     28-Aug-99 21:46:02
Subj: ... Perl

 ag> What echo do I areafix to talk about Perl running under OS/2?

This one.

--- Sqed/32 1.14/development
 * Origin: Schont die Umwelt: Vermeidet DOSen (2:2476/493)
104

+----------------------------------------------------------------------------+

From: Harald Pollack                                    20-Aug-99 08:19:01
  To: Andrew Grillet                                    31-Aug-99 07:03:12
Subj: Warp 3 withdrawal

Am 15. Aug 99 18:09, schrieb Andrew Grillet (2:254/259)
    an Sean Dennis:

Servus Andrew!

 AG> Perhaps you should check in a dictionary for the meaning of 
 AG> 'certified' :-)

:-)

Langenscheidts Taschenwoerterbuch, Englisch-Deutsch

certify:

bescheinigen; bezeugen; amtlich fr geisteskrank erklren ...

Herzliche Gruesse, Harald

-+- Message created on Friday August, 20 1999 08:22:00 EDT
--- WarpEd/2 1.11
 * Origin: LFP Schwechat [OS/2] (2:310/14.59)
2604/104

+----------------------------------------------------------------------------+

From: Sean Dennis                                       29-Aug-99 15:41:09
  To: Thomas Seeling                                    31-Aug-99 07:03:12
Subj: ... Perl

Hello Thomas.

26 Aug 99 09:37, you wrote to David Noon:

 TS> *_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^
 TS> F *$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$&&print time

What in God's name does that do? :P

Later,
Sean

... Oxymoron:  Moderate Liberal
--- AfterHours/2 and GoldED/2 : Enjoying the silence.
 * Origin: a..f..t..e..r..h..o..u..r..s..2..b..b..s (1:395/610)
2604/104

+----------------------------------------------------------------------------+

From: David Noon                                        29-Aug-99 18:21:01
  To: Thomas Seeling                                    31-Aug-99 07:03:12
Subj: ... Perl

In a message dated 08-26-99, Thomas Seeling said to David Noon about "...
Perl"

Hi Thomas,

> Funny how there's no Obfuscated Perl contest (or is there?).

TS>There sure is, the first winner was a cow-orker of mine who submitted
TS>this:

TS>*_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^F
TS>*$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$&&print time

I can see how one could ork a few cows with that. ... :-)

Regards

Dave
<Team PL/I>
___
 * MR/2 2.25 #353 * I wish life had a scroll-back buffer.....

--- Maximus/2 3.01
 * Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
2604/104

+----------------------------------------------------------------------------+

From: MIKE RUSKAI                                       30-Aug-99 00:43:00
  To: VITUS JENSEN                                      01-Sep-99 02:31:23
Subj: Terminating threads clean

Some senseless babbling from Vitus Jensen to Mike Ruskai
on 08-24-99  01:25 about Terminating threads clean...

 VJ> Hello Mike,

 VJ> 19.08.99 20:06, MIKE RUSKAI wrote a message to VITUS JENSEN:

[snip]
 
 MR> I don't know what other resources that would need to be recovered
 MR> from a thread.  As far as I can figure, a thread should release
 MR> any resources it's using by itself.

 VJ> The only resource DosWaitThread() could release is the exit code of
 VJ> the thread it waited for.  Obviously this information has to be stored
 VJ> somewhere outside of the died thread.  Writing another test program ...
 VJ> No, there is no difference between starting 200000 threads with and
 VJ> without DosWaitThread.  Either OS/2 uses a fixed size table or the
 VJ> amount of storage is to small to get noticed.

I just looked over the CP reference, and it was never stated (even 
implicitly) that DosWaitThread() *should* be called to recover resources.  
It was presented only as an option.  And it is also explicitly stated that 
the thread information block is maintained by the operating system.  That's 
the only memory allocated for each individual thread, apparently, and if 
OS/2 relied on DosWaitThread() to release that storage, the result would be 
a big memory leak.

My best guess is that OS/2 keeps a static array that indicates whether the 
thread ID is occupied, and holds a pointer to the TIB (and an indicator to 
which process ID it belongs).  My speculation beyond that is that when 
threads of a process are terminated, the process ID indicator remains 
intact, as well as the TIB storage.  When new threads are started, they are 
first given ID's that are not associated with any running processes, and 
when they are exhausted, begins recycling thread ID's that were previously 
used in the current process, and overwrites the TIB information.  At 
process end, all TIB structure storage for the process is released, and 
process ID associations removed.  

If my guess is correct (or nearly so), then there's no guarantee that the 
information in the TIB and TIB2 will remain valid after the thread has 
terminated, and before DosWaitThread() is called.  Of course, I don't see 
anything in that structure that's useful after the thread has ended, 
anyway.  If all thread ID's have TIB and TIB2 storage associated with them, 
that'd be only 160K of memory, which isn't very noticeable on the whole.

However, it is enough to notice in your test, probably, so the order of 
thread ID assignment may be either the opposite of what I suggested, or 
have no order a tall.  That is, either thread ID's previously used by the 
process are recycled first, or they are simply assigned in numeric order, 
without regard to which process they were previously associated with.  The 
latter looks perhaps more likely, as clearly thread ID's previously used by 
one process are available to other processes, even while the first process 
is still running.  Otherwise, something as simple as a daemon process that 
processes requests on newly-begun threads would quickly exhaust the 
system's thread resources.

Finally, I may be missing something, but I don't find anywhere for a thread 
to provide a return code, save in a structure pointed to by the thread's 
argument, which must be maintained by the application.

Mike Ruskai
thannymeister@yahoo.com


... Almost everything in life is easier to get into than out of.

___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
 * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
2604/104

+----------------------------------------------------------------------------+

From: MIKE RUSKAI                                       30-Aug-99 01:27:00
  To: EDDY THILLEMAN                                    01-Sep-99 02:31:23
Subj: Terminating threads clean

Some senseless babbling from Eddy Thilleman to Mike Ruskai
on 08-22-99  12:42 about Terminating threads clean...

 ET> Hi MIKE,

 ET> 20 Aug 99, MIKE RUSKAI of 1:3603/140 wrote to EDDY THILLEMAN:
 
 MR> Those are for making sure something is finished without being
 MR> interrupted by signals or exceptions.
 
 MR> The functions DosEnterCritSec() and DosExitCritSec() are
 MR> intended for making sure the current thread completes before
 MR> all others in the same process (by setting it at a higher
 MR> priority).

 ET> I thought that was by preventing being interrupted, not by setting it
 ET> at a higher priority?

No, it's actually by blocking the other threads.  I was confusing what was 
said in the reference.  What was actually said, aside from the fact that it 
causes other threads to block, was that the same effect could be achieved 
by giving the current thread a higher priority class (not just level, since 
that will vary when dynamic scheduling is enabled) than all others in the 
same process.

Mike Ruskai
thannymeister@yahoo.com


... Hey Billy, are you sure they wrote Windoze in Basic?

___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
 * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
2604/104

+----------------------------------------------------------------------------+

From: Eddy Thilleman                                    30-Aug-99 09:48:17
  To: Herbert Rosenau                                   01-Sep-99 02:31:23
Subj: Terminating threads clean

Hi Herbert,

28 Aug 99, Herbert Rosenau of 2:2476/493 wrote to Eddy Thilleman:

HR> No. DosEnterCritSec does not more than blocking all other
HR> threads of the same process. Other Threads of other
HR> processes can and will become CPU after timslice of the
HR> running thread is over.

Thanks.

HR> Most (but not all) OS/2 APIs calls DosExitCritSec() under
HR> cover. So you should not use any API (system, runtime,
HR> library) unless you know that this function would never call
HR> a system API.

I was not planning to call DosEnterCritSec() or DosExitCritSec().

  Cheers   -=Eddy=-        email: eddy.thilleman@net.hcc.nl

... Excuse the spelling, I have been snorting to much code.
--- MBM v4.14
 * Origin: regeldrukker: Een vreemde stoelgang. (2:500/143.7)
102

+----------------------------------------------------------------------------+

From: Rich Wonneberger                                  31-Aug-99 21:32:00
  To: Sean Dennis                                       01-Sep-99 08:21:24
Subj: ... Perl

*** Quoting Sean Dennis to Thomas Seeling dated 08-29-99 ***
> *_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^
>  TS> F *$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$&&print 
> time
> 
> What in God's name does that do? :P

Either it calculates PI to the last digit or just drives normal people crazy
trying to figure it out..

Hmmmm

Rich
I-Net   turtil@frontiernet.net


... If it's tourist season, where do I get a license?
---
 * Origin: Turtil's Pond BBS. Monroe NY.  914-783-2106 (1:2625/50)
102

+----------------------------------------------------------------------------+

From: John Hicks                                        02-Sep-99 17:37:00
  To: David Noon                                        02-Sep-99 13:32:20
Subj: OS/2 on a compaq?

Thanks for telling me that. I'll shift my hardware related questions there.

--- FMail/Win32 1.48
 * Origin: -= Night Runners Christchurch N.Z. 64-3-3383529 =- (3:770/320)
2604/104

+----------------------------------------------------------------------------+

From: Jonathan de Boyne Pollard                         30-Aug-99 10:39:08
  To: Herbert Rosenau                                   02-Sep-99 13:32:20
Subj: Terminating threads clean

 HR> Most (but not all) OS/2 APIs calls DosExitCritSec() under cover. So
 HR> you should not use any API (system, runtime, library) unless you know
 HR> that this function would never call a system API.

Actually, that's not quite the right explanation.  

The reason not to call APIs is as explained in the CP Guide and Reference. 
(The CPREF talks about "dynamic link library calls", but it is really talking
about APIs in any arbitrary libraries.  Even statically linked libraries can
be a problem if they use semaphores internally.)  If a second thread had been
already in that API when it was blocked by the first thread entering the
criticical section, then that second thread will possibly be holding a mutex
semaphore that restricts access to the internals of that API.  If the first
thread then attempts to use that API, it will block on the mutex whilst
holding the critical section, and the two threads will be deadlocked.

  JdeBP 

--- FleetStreet 1.22 NR
 * Origin: JdeBP's point, using Squish <yuk!> (2:257/609.3)
2604/104

+----------------------------------------------------------------------------+

From: Andrew Grillet                                    31-Aug-99 08:15:29
  To: Harald Pollack                                    02-Sep-99 13:32:20
Subj: Warp 3 withdrawal

Hi Harald,

-=> On 20 Aug 99  08:19:02 Harald Pollack said to Andrew Grillet <=-

 
 AG> Perhaps you should check in a dictionary for the meaning of 
 AG> 'certified' :-)

 HP> :-)

 HP> Langenscheidts Taschenwoerterbuch, Englisch-Deutsch

 HP> certify:

 HP> bescheinigen; bezeugen; amtlich fr geisteskrank erklren ...

Unfortunately the sum total of my knowledge of German is

Twei Bier und Ein Worstie, Bitte. .... Danke

Seems to work in Holland and Denmark also.

Andrew




... Please hold, a service representative will annoy you shortly.
--- Blue Wave/Max v2.30 [NR]
 * Origin: Me/2 <Meet-You> (2:254/259)
2604/104

+----------------------------------------------------------------------------+

From: MIKE RUSKAI                                       01-Sep-99 07:46:00
  To: SEAN DENNIS                                       02-Sep-99 17:37:18
Subj: ... Perl

Some senseless babbling from Sean Dennis to Thomas Seeling
on 08-29-99  15:41 about ... Perl...

 SD> Hello Thomas.

 SD> 26 Aug 99 09:37, you wrote to David Noon:
 
 TS> *_=\$#;$/=q#(.)#;$#=10;$^X=~s|.*/||;$\=chr;$#=gmtime$#;substr($#,$^F#^
 TS> F *$^F**$^F-1)=al;s$\$/( )\$/\$/$e\$2\u\$^X\$2\$3o\$1r$&&print time

 SD> What in God's name does that do? :P

It prints "The H:\PROGLANG\PERL\PERL5.EXE Journal".  Here, that is.

Mike Ruskai
thannymeister@yahoo.com


... Windows for Workgroups: Why crash 1 when you can crash 6?

___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
 * Origin: FIDO QWK MAIL & MORE!  WWW.DOCSPLACE.ORG (1:3603/140)
2604/104

+----------------------------------------------------------------------------+

From: Eddy Thilleman                                    02-Sep-99 08:32:15
  To: MIKE RUSKAI                                       03-Sep-99 15:30:15
Subj: Terminating threads clean

Hi MIKE,

30 Aug 99, MIKE RUSKAI of 1:3603/140 wrote to EDDY THILLEMAN:

MR> No, it's actually by blocking the other threads. 

OK.

MR> I was confusing what was said in the reference. 

Everyone is sometimes confused. :) You're not the first to be confused and you 
won't be the last, I can assume at least that much.

MR> What was actually said, aside from the fact that it causes
MR> other threads to block, was that the same effect could be
MR> achieved by giving the current thread a higher priority class
MR> (not just level, since that will vary when dynamic scheduling
MR> is enabled) than all others in the same process.

Except it isn't done this way, I heard. :)

MR> ... Hey Billy, are you sure they wrote Windoze in Basic?

and Windows 2000 is written in Visual Basic. ;-)

  Cheers   -=Eddy=-        email: eddy.thilleman@net.hcc.nl

... Only XT users know that 1-1-80 was on a Tuesday.
--- MBM v4.14
 * Origin: Roken is schadelijk voor gezonde mensen. (2:500/143.7)
102

+----------------------------------------------------------------------------+

+============================================================================+
