home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / ibm / pc / digest / 195 < prev    next >
Encoding:
Text File  |  1992-12-29  |  25.6 KB  |  712 lines

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!agate!ucbvax!WSMR-SIMTEL20.ARMY.MIL!Info-IBMPC
  2. From: Info-IBMPC@WSMR-SIMTEL20.ARMY.MIL ("Info-IBMPC Digest")
  3. Newsgroups: comp.sys.ibm.pc.digest
  4. Subject: Info-IBMPC Digest V92 #207
  5. Message-ID: <921227230806.V92N207@wsmr-simtel20.Army.Mil>
  6. Date: 29 Dec 92 12:31:05 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Reply-To: Info-IBMPC@wsmr-simtel20.ARMY.mil
  9. Organization: The Internet
  10. Lines: 698
  11. Approved: info-ibmpc@wsmr-simtel20.army.mil
  12. X-Unparsable-Date: Sun, 27 Dec 92 23:08:05 GMT+1
  13.  
  14. Info-IBMPC Digest           Sun, 27 Dec 92       Volume 92 : Issue 207 
  15.  
  16. Today's Editor:
  17.          Gregory Hicks - Rota Spain <GHICKS@wsmr-simtel20.Army.Mil>
  18.  
  19. Today's Topics:
  20.                   32-bit programming using MASM 6.00b
  21.                           ATI driver support!
  22.                             CKermit - help!
  23.                       Re: OS/2 2.0 32 bit drivers!
  24.               Cry for Help: TCP/IP programming API wanted
  25.                           Customizing EPM 5.51
  26.            Detecting ANSI.SYS (was: Re: DOS text attributes)
  27.                               DLL question
  28.                            Help hook solution
  29.             IBM TCP/IP: how to get my own address? (2 msgs)
  30.                       keybinding in OS/2 gnuemacs
  31.                     OS/2: leave it running?(2 msgs)
  32.                  OS/2 libraries thread-safe ? (2 msgs)
  33.                    This is strange, div doesn't work
  34.                     where should SET name=thing go?
  35.  
  36. Send Replies or notes for publication to: <INFO-IBMPC@brl.mil>
  37.  
  38. Send requests of an administrative nature (addition to, deletion from
  39. the distribution list, et al) to: <INFO-IBMPC-REQUEST@brl.mil>
  40.  
  41. Addition and Deletion requests for UK readers should be sent to:
  42. <INFO-IBMPC-REQUEST@DARESBURY.AC.UK>
  43.  
  44. Archives of past issues of the Info-IBMPC Digest are available by FTP
  45. ONLY from WSMR-SIMTEL20.ARMY.MIL in directory PD2:<ARCHIVES.IBMPC>.
  46.  
  47. ----------------------------------------------------------------------
  48.  
  49. Date: 16 Dec 92 22:37:57 GMT
  50. From: Kai Uwe Rommel <rommel@jonas.gold.sub.org>
  51. Subject: 32-bit programming using MASM 6.00b
  52.  
  53. jawetzel@athena.mit.edu (The Rottweiler) writes:
  54. >Is there anyone out there who has experience assembling 32-bit OS/2
  55. >v2.0 programs using Microsoft's MASM 6.00b.  I thought that I could use
  56. >the flat memory model but LINK386 chokes on the object code.  LINK386
  57. >does not complain if I use the normal segmented model but the EXE
  58. >created generates a 000E trap.
  59.  
  60. What probably happens is, that you call the *16-bit* DOS calls in your
  61. program. The 32-bit ones are prefixed with Dos32 instead of Dos, i.e.
  62. Dos32Write and so on. Working example:
  63.  
  64. ----------------------------------------------------
  65. .386
  66. .model    flat
  67. .stack    04000H
  68.  
  69. includelib doscalls.lib
  70.  
  71. .data
  72.  
  73. message    byte    13, 10, "Hello, world.", 13, 10
  74.  
  75. .data?
  76.  
  77. count   dword    ?
  78.  
  79. .code
  80.  
  81. extern    DOS32WRITE:proc
  82. extern    DOS32EXIT:proc
  83.  
  84. start   proc
  85.  
  86.     push    offset count
  87.     push    lengthof message
  88.     push    offset message
  89.     push    1
  90.         call    DOS32WRITE
  91.  
  92.         push    27
  93.         push    1
  94.     call    DOS32EXIT
  95.  
  96. start    endp
  97.     
  98.     end    start
  99. ----------------------------------------------------
  100.  
  101. Kai Uwe Rommel
  102.  
  103. --
  104. /* Kai Uwe Rommel                                      Muenchen, Germany *
  105.  * rommel@jonas.gold.sub.org                       Phone +49 89 723 4101 *
  106.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  107.  
  108. DOS ... is still a real mode only non-reentrant interrupt
  109. handler, and always will be.                -Russell Williams
  110.  
  111. ------------------------------
  112.  
  113. Date: 17 Dec 92 23:15:01 GMT
  114. From: Ted Chen <tedc@cs.ubc.ca>
  115. Subject: ATI driver support!
  116.  
  117. timbol@netcom.com (Mike Timbol) writes:
  118. >samiam@netcom.com (Scott Moore) writes:
  119. >>The salesman at Comdex may have not been well informed, but I was
  120. >>told that ATI is doing *ZIP* about ultra pro drivers for os/2 2.0, but
  121. >>only distributing IBM written code. They were showing it off right next
  122. >>to their brand new (ATI written) NT driver.
  123. >>Scott
  124.  
  125. >On CompuServe, someone from ATI said they were working on Ultra Pro
  126. >drivers and were targeting 2nd Quarter '93.  They were "thinking about"
  127. >or "looking at" doing drivers for the VGA Wonder cards.  By the way, a
  128. >great many people on CompuServe are very very pissed at ATI.
  129. >
  130. >     - Mike
  131.  
  132. For all you ATI Vantage/Ultra/8514/a/Ultra Pro/+ users, why not send
  133. some email to ATI to voice your displeasure at their absence of drivers
  134. for OS/2 2.0.
  135.  
  136. I believe their email address at CIS is
  137.  
  138. 74740.667@compuserve.com
  139.  
  140. Ted Chen   <tedc@ee.ubc.ca>
  141.  
  142. ------------------------------
  143.  
  144. Date: 17 Dec 92 07:57:35 GMT
  145. From: Steve Lumos <slumos@unlv.edu>
  146. Subject: CKermit - help!
  147.  
  148. harriga@duc.auburn.edu (Greg A. Harris) writes:
  149.  
  150. >???? You cannot "connect" until you "dial". Look at ckermit.ini. Make
  151. >sure it has your modem listed in 'set modem' and check the 'set port'.
  152. >Then do 'dial 123-4567' to dial. Then do connect.  Read ckoker.doc
  153. >(packaged in the ckermit 5A(188) files in pub/uploads) to find the
  154. >procedure to automate the logon with scripts, once you get things
  155. >working.
  156.  
  157. Note: I cannot figure out how to make it stop setting my port speed to
  158. the connect speed reported by the modem. I want my com port to stay
  159. locked at 57600, but CKermit adjusts it to 14400 when it sees the
  160. CONNECT 14400 message. This is a real pain and I have to escape back
  161. and reset the speed. To avoid having to do this, I go:
  162.  
  163. C-Kermit>set carrier off
  164. C-Kermit>c
  165.  
  166. It doesn't complain then...
  167.  
  168. Steve Lumos - slumos@cs.unlv.edu
  169.  
  170. ------------------------------
  171.  
  172. Date: 18 Dec 92 07:32:03 GMT
  173. From: "Sean P. Frigo UW-Madison SRC (608" <frigo@psl.wisc.edu>, 
  174. Subject: Re: OS/2 2.0 32 bit drivers!
  175.  
  176. The following is an excerpt from an e-mail sent to me by ATI in
  177. response to my request about OS/2 2.0 32 bit drivers:
  178.  
  179.  
  180. From: ATI Support <74740.667@CompuServe.com>
  181. Date:  12-17-92
  182.  
  183. As can found here in the ATI forum in CompuServe, or by contacting ATI
  184. support, IBM has not yet released the Development Kit which allows us
  185. to complete 32 bit video drivers for OS/2 (and you will not find any
  186. other video board manufacturers with 32 bit video drivers on the
  187. market). IBM has not even released their own 8514/A 32 bit driver yet!
  188. Once we have the development kit, we will be able to complete and
  189. release 32 bit drivers. Meanwhile, the current OS/2 drivers we supply
  190. will work with the versions of OS/2 1.3x and 2.x, with the 16 bit
  191. Graphics Engine.
  192.  
  193. Regards,
  194.  
  195. Allan Nelson,
  196. ATI Customer Support>>>
  197.  
  198. (1)    I thought Trident had released 32 bit drivers.  If so, how
  199. could they have done it w/out the Development Kit from IBM?  Or, is ATI
  200. the party at fault, since the above is in error and the kit exists?
  201.  
  202. (2)    If the kit hasn't been released yet, when will it be?  Let's
  203. hope it is soon!
  204.  
  205. Sean P. Frigo                  internet: frigo@src.wisc.edu
  206. UW-Madison SRC and Department of Physics    bitnet:  frigo@wiscpsl
  207. 3731 Schneider Drive                         voice:  (608)877-2332
  208. Stoughton WI 53589-3097                        fax:  (608)877-2001
  209.  
  210. ------------------------------
  211.  
  212. Date: 16 Dec 92 17:48:49 GMT
  213. From: Scott Abfalter <thx1138@angus.mi.org>
  214. Subject: Cry for Help: TCP/IP programming API wanted
  215. Keywords: MSDOS, TCP/IP, Sockets
  216.  
  217. Help: 
  218.  
  219. I am going to be rewriting LAN software for my company and we need to
  220. use TCP/IP and some sort of socket API.
  221.  
  222. We're not happy using FTP software's PC/TCP for DOS because the
  223. programmers development kit forces you to replace the Microsoft system
  224. include files with their own butchered version.
  225.  
  226. We cannot use Beame & Whitesides TCP/IP and socket library either.  We
  227. must operate in a nonblocking mode and their socket library blocks on a
  228. soclose() call if there is a physical break in communications.
  229.  
  230. I am currently looking into both Network Researches "Fusion for DOS"
  231. and Novell's LAN WorkPlace Toolkit (for LAN WorkPlace for DOS) as a
  232. replacement solution.
  233.  
  234. Has anyone out there reading this had experience with either of the two
  235. mention packadges?  Can anyone reccommend any others?  I need help as
  236. I've already bought two packadges only to find out their limitations
  237. and am hesitant to buy any more until I know for sure that they are any
  238. good.
  239.  
  240. _ANY_ advice on this would be _GREATLY_ appreciated!!!  Thanks! 
  241.  
  242. Scott
  243. Scott Allen Abfalter
  244. Intellivoice Communications
  245. (313) 488-0180 xt. 661 
  246. thx1138@angus.mi.org _or_  ici@msen.com
  247.  
  248. ------------------------------
  249.  
  250. Date: 17 Dec 92 19:11:08 GMT
  251. From: KUMARADAS JOSEPH CARL <kumarad@ecf.toronto.edu>
  252. Subject: Customizing EPM 5.51
  253.  
  254. nicolson@odie.ee.wits.ac.za (James Nicolson) writes:
  255.  
  256. >I am using EPM v5.51 from software.watson.ibm.com. (Its seems like a
  257. >really good editor)
  258.  
  259. >When it comes to customizing it, I ran into a problem. Even without 
  260. >including my own .e files (mystuff.e etc.), the translator (etpm) complains
  261. >about the .ex file being bigger than the allowed 64k. Ie. all I am doing is:
  262. >  etpm epm
  263. >using the macro files as supplied in epmmac.zip.
  264. >
  265. >Am I missing something?
  266.  
  267. You should add the WANT_EXTRA=1 (or something to that effect) to a
  268. mycnf.e file.  The .ex files are for some reason limited to 64k eac.
  269. The WANT_EXTRA will put the rest on a second file which must also be
  270. created by compiling the extra.e macro file.
  271.  
  272. Carl. 
  273.  
  274. ------------------------------
  275.  
  276. Date: 17 Dec 92 17:28:49 GMT
  277. From: GUNNAR HORRIGMO <gunnarh@dhhalden.no>
  278. Subject: Detecting ANSI.SYS (was: Re: DOS text attributes)
  279.  
  280. From: ceharris@csugrad.cs.vt.edu (Carl Harris)
  281.  
  282. >wizard@archtwr.tower.nullnet.fi (Mikko H{nninen) writes:
  283. >> I know I can detect ANSI driver by comparing an interrupt's and the CON
  284. >> device's segment addresses (I think). But is this reliable? Are there any
  285. >> other programs aside from ANSI that act as the CON device?
  286. >
  287. >The standard method for detecting the presence of the ANSI driver is to
  288. >send a DSR (Device Status Report) sequence to the console.  If the
  289. >driver is present, it will respond with a CPR (Cursor Position Report) via
  290. >standard input.
  291.  
  292. I don't know what it really does, but there is an int 21 (?) ANSI.SYS
  293. installation check.
  294.  
  295.   /                \   |Gunnar Horrigmo          |
  296. /____________________\ |gunnarh@sofus.dhhalden.no| 
  297.  
  298. ------------------------------
  299.  
  300. Date: 18 Dec 92 20:46:37 GMT
  301. From: David Charlap <dic5340@hertz.njit.edu>
  302. Subject: DLL question
  303. Keywords: DLL library
  304.  
  305. deepakd@ural.Eng.Sun.COM (Deepak Dhamdhere) writes:
  306. >I have an application that calls functions from ABC.DLL, those
  307. >functions call routines from XYZ.DLL and those, in turn, call routines
  308. >from the C library. This application starts a child process using
  309. >DosExecPgm, which in turn, does the same thing. I have used
  310. >llibcdll.lib to link all these programs and libraries.
  311.  
  312. Are you also using the compiler switches to ensure that DS!=SS and that
  313. DS is always loaded on process entry.  I think these are in the keyword
  314. EXPENTRY.  I believe that any functions you export to a DLL must be
  315. declared with this.
  316.  
  317. >Very frequently, it generates a segementation violation. When I
  318. >checked with Codeview, I found that the malloc() call fails because it
  319. >tries to load a non-existent segment into DS.
  320.  
  321. It sounds like the DLL is (correctly) assuming that DS!=SS, and is
  322. loading it, but the calling program isn't providing the segment.  Be
  323. sure that the code and headers are using the EXPENTRY keyword for all
  324. exported functions.
  325.  
  326. >Any clues to why is this happening ? I would like to know the correct
  327. >way of compiling and linking ABC.DLL, XYZ.DLL and the applications.
  328.  
  329. In general, I don't like to call C run-time functions from DLL's, but
  330. that's a different story.  Some compilers (like EMX/GCC) have the C
  331. library functions in a DLL, so there's little linkage problems, but you
  332. can't do that with MS-C.
  333.  
  334.   |)  David Charlap          | .signature confiscated by FBI due to
  335.  /|_  dic5340@hertz.njit.edu | an ongoing investigation into the
  336. ((|,)                        | source of these .signature virusses
  337.  ~|~
  338.  
  339. ------------------------------
  340.  
  341. Date: 16 Dec 92 15:05:10 GMT
  342. From: "Larry Salomon Jr." <os2man@panix.com>
  343. Subject: Help hook solution
  344.  
  345. Some time ago, I posted a desperate plea for help with providing help
  346. for message boxes via the help hook (the only possible way to do so).
  347. I did everything according to the documentation to no avail; I could
  348. not get the "Help" button to work.
  349.  
  350. Well, the documentation was wrong and has been since OS/2 1.2 (both
  351. IBM's Programming Guide and MS's QuickHelp overviews are incorrect).
  352. They state that, if you are going to use a help hook, it should be
  353. installed PRIOR to creating the help instance, since it too installs a
  354. help hook to perform its function.  However, if you assume for the
  355. moment that it uses the WinSetHook() function to do so and look in the
  356. docs for that, you'll see that the call installs the hook at the *head*
  357. of the hook chain.
  358.  
  359. That means, for those who don't already see the problem :) , that if I
  360. install A and the HM installs hook B afterwards, the hook chain is
  361. B->A; but the HM never calls the next hook!
  362.  
  363. When I moved the WinSetHook() to after the WinAssociateHelpInstance()
  364. call everything worked fine.
  365.  
  366. You would think that *someone* *somewhere* would have found this doc
  367. error, but *AP*p*AR*ently not.  IBM, please fix this.
  368.  
  369. Cheers,
  370. Q
  371.  
  372. ------------------------------
  373.  
  374. Date: 16 Dec 92 22:34:03 GMT
  375. From: Kai Uwe Rommel <rommel@jonas.gold.sub.org>
  376. Subject: IBM TCP/IP: how to get my own address????
  377.  
  378. If I use IBM's TCP/IP, how am I supposed to get the host name/address
  379. of the local system? There is no gethostname() call and gethostid()
  380. always returns -1. Could anyone PLEASE tell me how I can solve this
  381. stupid problem? What else can I do (except perhaps calling sock_init())
  382. before calling gehostid() to have it succeed?
  383.  
  384. Is it me that I don't see an overly simple solution or is the
  385. programmer's kit of IBM's TCP/IP so bad?
  386.  
  387. Thanks,
  388.  
  389. /* Kai Uwe Rommel                                      Muenchen, Germany *
  390.  * rommel@jonas.gold.sub.org                       Phone +49 89 723 4101 *
  391.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  392.  
  393. DOS ... is still a real mode only non-reentrant interrupt
  394. handler, and always will be.                -Russell Williams
  395.  
  396. ------------------------------
  397.  
  398. Date: 17 Dec 92 16:39:21 GMT
  399. From: Oleg Vishnepolsky <oleg@watson.ibm.com>
  400. Subject: Re: IBM TCP/IP: how to get my own address????
  401.  
  402. rommel@jonas.gold.sub.org (Kai Uwe Rommel) writes:
  403. >[... Text of Query deleted...]
  404.  
  405. You have to call sock_init() before calling gethostid().
  406.  
  407. Oleg Vishnepolsky
  408.  
  409. ------------------------------
  410.  
  411. Date: 17 Dec 92 13:03:28 GMT
  412. From: Jochen Bedersdorfer <beders@wip-sol.dfki.uni-sb.de>
  413. Subject: keybinding in OS/2 gnuemacs
  414.  
  415. rogoff@netcom.com (Carolyn Rogoff David Rogoff) writes:
  416.  
  417. >   I've been using the OS/2 2.0 gnuemacs for a few weeks now.  I've
  418. >used emacs and epoch on Suns for year and to me the best part of emacs
  419. >is assigning function to keys.  I have tried with several people's
  420. >hints to map the PC keyboard, but I haven't gotten anywhere.
  421.  
  422. >   I want to be able to do simple things like map the arrow keys to
  423. >forward-char etc., page up/page down, and the 12 function keys.  Below
  424. >is a part of my .emacs on the Sun.
  425.  
  426. If you have the port of Eberhard Mattes (I don`t know any other), there
  427. should be a file em-keys.el (??? I am not shure, but `em` is okay).
  428.  
  429. There are most bindings for PC-Keyboards (Functionskeys, Arrowkeys
  430. etc.).  That should do the trick !
  431.  
  432. BTW, anyone interested in having ALT-PAGEUP doing
  433. scroll-other-screen-up (ALT-PAGEDOWN is doing scroll-other-screen-down)
  434. ?  If so, I`ll post the changings...
  435.  
  436. :)ochen
  437.  
  438. ------------------------------
  439.  
  440. Date: 18 Dec 92 20:04:04 GMT
  441. From: Barry R Solway <banshee@bach.udel.edu>
  442. Subject: OS/2: leave it running?
  443.  
  444. >serls@dashs.denver.co.us (Dave Serls) writes:
  445.  
  446. >  I'm wondering how many users keep their OS/2 2.0 machines running
  447. >full-time; that is, 24 hours a day.  Is there any benefit gained,
  448. >thereby; or, are shorter sessions less injurious to HD hardware.
  449.  
  450.     I've had OS2 2.0 loaded since August or so. I hardly ever  turn
  451. it off, except sometimes  at night if I don't think I will be  using it
  452. the next day, or when my roommates want to boot with Dos to play games.
  453. Never had any problems and like another poster said, it's common belief
  454. that the stress on the I.C. chips is greater during power on/off then
  455. normal running wear and tear.
  456.  
  457. % banshee @brahms.udel.edu     % 
  458. % solway @freezer.cns.udel.edu %
  459.  
  460. ------------------------------
  461.  
  462. Date: 18 Dec 92 16:28:06 GMT
  463. From: Kevin Andrew Buhr <buhr@umanitoba.ca>
  464. Subject: OS/2: leave it running?
  465.  
  466. serls@dashs.denver.co.us (Dave Serls) writes:
  467.  
  468. >  I'm wondering how many users keep their OS/2 2.0 machines running
  469. >full-time; that is, 24 hours a day.  Is there any benefit gained,
  470. >thereby; or, are shorter sessions less injurious to HD hardware.
  471.  
  472. Many people claim that the heat-cool cycle of powering a computer on
  473. and off is much harder on the "solid-state" components than leaving it
  474. on all the time is on the hard drive.
  475.  
  476. Unless your hard drive is incredibly flaky, it should be safe to leave
  477. it on pretty much all the time.  There is no contact between the head
  478. and the platter, so the only "deterioration" in an idle (but spinning)
  479. drive would be in the rotor mechanism.  I don't think this is a big
  480. concern.
  481.  
  482. In conclusion, leaving your OS/2 station on is fine.  I would be sure
  483. to check that the vents are clear and the fan is running, though.  ;)
  484.  
  485. Kevin <buhr@ccu.UManitoba.CA>
  486.  
  487. ------------------------------
  488.  
  489. Date: 17 Dec 92 17:00:43 GMT
  490. From: Jeff Urlwin <jurlwin@gandalf.umcs.maine.edu>
  491. Subject: OS/2 libraries thread-safe ?
  492.  
  493. etxabju@eua.ericsson.se writes:
  494. >ernst@opal.cs.tu-berlin.de (Ernst Kloecker) writes:
  495.  
  496. >>what precautions do I have to take when calling C-library functions from
  497. >>different threads in one process ?
  498.  
  499. >What C library? I can only speek for Microsoft C 6.0. I not quite sure 
  500. >about IBM Cset/2 yet, but I think the answers are applicable for that
  501. >library as well.
  502. >
  503. >There are (at least) two versions of the library - one "normal" and one 
  504. >thread safe.  In MSC you invoke the thread safe library with -MT.
  505.  
  506. When you compile with the option /Gm+ and link with the multithreaded
  507. library, you should be OK.  You should use _beginthread() to start your
  508. thread.  It sets up the correct behavior of the library routines.
  509. (NOTE: if you use /Gm+ and have ICC call the linker for you, it will
  510. grab the multithreaded libs for you...)
  511.  
  512. >>What happens to static variables like 'errno' ?
  513. >
  514. >No problem. errno is redefined with the preprocessor to a thread-safe
  515. >function: 
  516. >  #define errno thread_safe_errno_function() 
  517. >or something like that.
  518.  
  519. errno is actually a function call with the CSet/2.  It will properly
  520. deal with the multiple threads.  I forget, but I think it's defined as:
  521.  
  522. extern _Optlink int *_errno(void); 
  523. #define errno  (*_errno())
  524.  
  525. Don't quote me on this, but I know I've seen this somewhere...
  526.  
  527. >>Can I safely call '...printf()' from different threads ?
  528.  
  529. >Not quite sure, but I think so. printf/sprintf etc uses (in MSC) a
  530. >static result array. This array is guarded with semaphores. However,
  531. >there can be a small risk that the output from several threads are
  532. >mixed with each other (but only one of them calls printf() of course).
  533.  
  534. Well sprintf shouldn't be a problem, because you supply the buffer.
  535. (just don't call it with the same buffer...).  printf could either:
  536. guard the use by semaphores or dynamically allocate the memory.  Either
  537. way you *should* be OK with the call.  Where you might run into
  538. problems is when looking at the info.  If your stdout (or your FILE) is
  539. buffered in any way, you could be seeing some messed up stuff...or at
  540. least the info will be interleaved...
  541.  
  542. If this is for debugging, let me tell you what I've done in the past
  543. (on Transputers, where you have multiple threads AND multiple
  544. processors -- non shared memory across the processors) is to have the
  545. notion of a timestamp and do a fprintf from each thread with the
  546. timestamp, thread id (and processor, in that case) and debugging
  547. message.  Then you can have a program merge the info into one file,
  548. based upon time.  So you might see.  in file 1: 1 In thread1 4 start
  549. calculating pi 10 finished first approx
  550.  
  551. in file 2:
  552. 2 finished setup of thread 1
  553. 5 got user input
  554. 11 got finished pi...
  555.  
  556. etc.
  557.  
  558. It's pretty simple at this point to concatenate the files and sort them
  559. by time...this way you can see what's really going on...somewhat
  560. realtime.
  561.  
  562. You have to be careful, though, that you're not putting in too much
  563. printing in one thread and changing the timing of the threads and how
  564. they interact.  I've seen it happen most of the time where introducing
  565. debugging printfs, etc actually "solves" the problem....you're in for a
  566. fun hunt then!
  567.  
  568. >>Or are the only safe functions the OS-functions in 'bsedos.h' ?
  569.  
  570. >>Or are even those functions not completely thread-safe ?
  571.  
  572. >Not absolutly sure how they are implemented, but functions like
  573. >strtok(), localtime(), gmtime() etc seems a bit dangerous - I guard
  574. >them with a semaphore when I use them.
  575.  
  576. I agree.  It's better to be careful, until you can see somewhere that
  577. they ARE re-entrant.  Maybe someone at IBM can tell us which calls are
  578. re-entrant and which aren't.  I would have to assume (until I could
  579. test further) that the Dos, Win, etc calls are re-entrant, but I would
  580. check that...
  581.  
  582. >>Thanks for any info, Ernst.
  583.  
  584. >No problem. Hope it helped. Can someone with experience from Cset/2
  585. >and emx tell how it's done there?
  586.  
  587. I hope someone who is more "in the know" than I am could continue this...
  588.  
  589. Does anyone have any neat tricks/techniques for debugging this stuff?
  590. Maybe the fact that my background is more in parallel processing, I
  591. don't see how people are using it here...maybe I go a little
  592. overboard...
  593.  
  594. Jeff
  595. jurlwin@gandalf.umcs.maine.edu
  596.  
  597. ------------------------------
  598.  
  599. Date: 17 Dec 92 21:30:38 GMT
  600. From: Bruce Kitchin <kitchin@lf.hp.com>
  601. Subject: OS/2 libraries thread-safe ?
  602.  
  603. Ernst Kloecker (ernst@opal.cs.tu-berlin.de) wrote:
  604.  
  605. The C library has been pretty well handled by the other responses.  If
  606. you compile properly with IBM C Set/2 (set the multithreaded compile
  607. option) you should be completely safe except from your own
  608. multithreaded errors (simultaneous access of shared globals without
  609. semaphore protection).
  610.  
  611. : Or are the only safe functions the OS-functions in 'bsedos.h' ?
  612. : Or are even those functions not completely thread-safe ?
  613. All functions declared through including os2.h (includes bse*.h, pm*.h,
  614. etc) are safe.  They are part of or attached to the operating system
  615. which is designed for such problems.  They are not part of the C
  616. library.  Again, you can get into trouble due to sharing your own
  617. variables.  But I believe that every Dos, Win, Gpi, Mou, Kbd, Vio, etc
  618. call is atomic to the extent that anything that it depends on in the
  619. system (such as file buffers) are modified without the chance of
  620. another thread getting in.  However, two DosWrite's in a row may be
  621. split by a DosWRite from another thread.
  622.  
  623. ------------------------------
  624.  
  625. Date: 18 Dec 92 14:48:24 GMT
  626. From: Steve Madsen <sjmadsen@apsvax.aps.muohio.edu>
  627. Subject: This is strange, div doesn't work....
  628.  
  629. Michael Duffy (mduffy@aludra.usc.edu) wrote:
  630. : The following code gives me a divide error:
  631. :  mov  ax,0035h
  632. :  mov  dx,01h
  633. :  div  dx
  634. :
  635.  
  636.     I'm not a genius at assembler, but after looking in my TASM 3.2
  637. quick-ref, this is about the only thing I could come up with:
  638.  
  639.     What it appears is that you are doing a simple 16-bit divide.
  640. As far as my manual is concerned, if you do a div instruction with a
  641. 16-bit operand (such as dx in your example), then it uses DX:AX as your
  642. dividend.  This might be why you are having a problem, but it's only a
  643. guess.
  644.  
  645.     You could try changing DX to DL and see if that works.  Since
  646. you are assigned DX to what looks like a byte value anyway, this might
  647. solve your problem.
  648.  
  649. ------------------------------
  650.  
  651. Date: 18 Dec 92 16:51:10 GMT
  652. From: Kevin Andrew Buhr <buhr@umanitoba.ca>
  653. Subject: where should SET name=thing go?
  654.  
  655. In article <Bz9vtp.2uz@knot.ccs.queensu.ca> calvert@QueensU.CA (John
  656. Calvert) writes:
  657. >
  658. >  What do you mean here "specific DOS"?
  659.  
  660. A VDM session:  this is a feature whereby it is possible to "boot" a
  661. session from drive A and have it run just as if it was run on a normal
  662. 8088 machine.  In this way, you could boot an old version of DOS, if
  663. you had a program that wasn't compatible with OS/2's version of DOS,
  664. for example.  You could also run a program that required booting from a
  665. drive, even a program that didn't use DOS, provided that program didn't
  666. try to use any protected mode features.
  667.  
  668. In this case, of course, the "AUTOEXEC.BAT" that is run is the one on
  669. the floppy disk, if any.
  670.  
  671. >  If CONFIG.SYS is for OS/2, and AUTOEXEC.BAT is for DOS, where is the
  672. >  normal DOS CONFIG.SYS stuff? 
  673. >
  674. >  Is this all contained in the Settings, Session, DOS Settings for each 
  675. >  application? What if I want to change some config setting for all my
  676. >  DOS appls? Do I have to edit every Settings entry?
  677.  
  678. Yes, it is contained there.  You'll find the "FILES" and "BUFFERS" and
  679. "DOS_DEVICE" settings, for example, replace their counterparts in the
  680. DOS CONFIG.SYS.
  681.  
  682. If you'd like to change the settings for programs you create "from now
  683. on", you can change the settings in the program template.  Then, when
  684. you create a new program object, it will have the new defaults.  In the
  685. CSD, there is a "DOS/Windows Settings" icon somewhere in the System
  686. Setup folder.  I believe some settings can be given global values here.
  687.  
  688. >  This would be a very messy way do go.
  689.  
  690. Not particularly.  I think its a smart idea to have separate settings
  691. for each program.  That way, changes to one program's settings won't
  692. have adverse effects on another session.  Under DOS, I don't think I've
  693. ever had application A *benefit* from a change I've made to the
  694. CONFIG.SYS to get application B to run.  Usually, changes I make for
  695. application A's sake cause problems.
  696.  
  697. There are exceptions, of course.  "DOS=HIGH,UMB" is something I want
  698. for every application.  Luckily, OS/2 lets me put this line in the OS/2
  699. "CONFIG.SYS" where it influences all the DOS sessions, if I remember
  700. correctly.
  701.  
  702. Kevin <buhr@ccu.UManitoba.CA>
  703.  
  704. ------------------------------
  705.  
  706. End of Info-IBMPC Digest V92 #207
  707. *********************************
  708. -------
  709.