home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,011 of 2,978   
   William J. Leary Jr. to All   
   Re: cooperative multitasking: how to dea   
   09 Jan 06 23:42:22   
   
   From: Bill_Leary@msn.com   
      
    wrote in message   
   news:1136856922.613941.261310@f14g2000cwb.googlegroups.com...   
   > I still use TP7 with old DOS machines for lab data acquisition and   
   > control.   
   >   
   > I recently have been playing around with an excellent cooperative   
   > multitasking unit named "MTASK" written in the late 80's by Wayne   
   > Conrad.   
      
   I've used that as well, though in (if I recall correctly) TP 5.5.  Very nicely   
   done.   
      
   > It seems to be very stable and does exactly what I want, *except* for   
   > the problem of "READLN":   When a task executes a READLN   
   > statement, you get stuck inside Borland's RTL code waiting for the   
   > user to key something in, and you can't release that time to the other tasks.   
   >   
   > So.....   
   >   
   > 1) Is there a version of the CRT unit which has been patched to do a   
   > far call to a user-defined procedure when it is busy waiting within the   
   > READLN code?   
   >   
   > or   
   >   
   > 2) Is there a unit (with source) which provides equivalent READLN   
   > functionality, that I could patch to add a call to the task switcher   
   > when the READLN is busy waiting?   
      
   I solved the problem by writing a new Text Device Driver for the console which   
   made BIOS calls in my replacement for InOut so it would check for a character   
   before doing input..  If there was no character, it dispatched to the MTASK   
   scheduler and, upon return, tried again.  If there was one, it picked it up and   
   returned it.  In my case, I just made sure only one task did I/O.  Or I may   
   have had the Open function fail for subsequent calls.  Been a long time so I   
   don't recall exactly.  I also recall seeing a similar package (unit) by someone   
   else which did pretty much the same thing, but I'd already done mine by then so   
   didn't bother to use that one.   
      
       - Bill   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca