| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, What does it mean error :"Fatal error os reentered"when I run this code below: Is there some tutorial for using MODULE PROCESS.DEF in Top Speed M2 Library? I tried this code: MODULE Procesi1; IMPORT IO; FROM Process IMPORT StartProcess,StartScheduler; CONST n1=10000; n2=10000; p1=1; p2=2; VAR x:CARDINAL; PROCEDURE Process1; BEGIN LOOP IO.WrStr("Prvi"); IO.WrLn; x:=IO.RdCard(); END; END Process1; PROCEDURE Process2; BEGIN LOOP IO.WrStr("Drugi"); IO.WrLn; x:=IO.RdCard(); END; END Process2; BEGIN (*main*) StartScheduler; StartProcess(Process1,n1,p1); StartProcess(Process2,n2,p2); END Procesi1. |
|
#2
| |||
| |||
| Damjan Martic wrote: > Hi, > What does it mean error :"Fatal error os reentered"DOS Found itself running a low level routine that was not reentrant. Almost certainly at the lower levels of ReadCard() > when I run this code below: > Is there some tutorial for using MODULE PROCESS.DEF in Top Speed M2 Library? None that you can rely upon. From memory there is a DOSCALL that returns a pointer to a BOOLEAN called something like DosCriticalSection. If you are already inside some bit of MSDOS that isn't reentrant then this is variable is set to a defined state. I thought there was a multithread defended DOS version in v3.xx but it would not surprise me if there were interesting bugs in it. Life gets even more interesting if you try to do floating point arithmetic in multiple threads with JPI under DOS. Regards, Martin Brown |
|
#3
| |||
| |||
| In article <ddgeaf$v4n$1@newsm1.svr.pol.co.uk>, Martin Brown <|||newspam|||@nezumi.demon.co.uk> wrote: > Damjan Martic wrote: > > Hi, > > What does it mean error :"Fatal error os reentered"> > DOS Found itself running a low level routine that was not reentrant. > Almost certainly at the lower levels of ReadCard() > > > when I run this code below: > > Is there some tutorial for using MODULE PROCESS.DEF in Top Speed M2 Library? > > None that you can rely upon. From memory there is a DOSCALL that returns > a pointer to a BOOLEAN called something like DosCriticalSection. > > If you are already inside some bit of MSDOS that isn't reentrant then > this is variable is set to a defined state. I thought there was a > multithread defended DOS version in v3.xx but it would not surprise me > if there were interesting bugs in it. > > Life gets even more interesting if you try to do floating point > arithmetic in multiple threads with JPI under DOS. > > Regards, > Martin Brown As I recall, any calls that do any form of I/O whatever (IO.anything, FIO.anything, etc) must be bracketed with calls to PROCESS.Lock and PROCESS.Unlock, otherwise the house of cards comes down. DOS is not re-entrant. LOCK turns total control of the machine over to the one single process; the call to Unlock resumes normal time-slicing. In the end, it all works, but it's pretty 'jerky' when there's a any I/O happening. - Chris |
|
#4
| |||
| |||
| Damjan Martic turpitued: >Hi, >What does it mean error :"Fatal error os reentered">when I run this code below: >Is there some tutorial for using MODULE PROCESS.DEF in Top Speed M2 Library? I went through this exercise years ago, and discovered that extreme care must be used in calling anything in MS-DOS or even in the machine BIOS, because the software in those places does things that are incompatible with multithreading. My own solution was to avoid module Process completely, and to implement my own multitasking kernel in M2. You can find the results at ftp://eepjm.newcastle.edu.au/pmos.zip [Warning: the domain eepjm.newcastle.edu.au is likely to disappear without warning some time in the next few months, and my M2 web pages (which I unfortunately entrusted to another server) have disappeared already. I shall try to port all this stuff over to another domain as soon as possible, but it's going to take time, so anyone who wants anything from either my ftp server or my web server should grab it as soon as possible.] To get around the problem of non-reentrant DOS and BIOS, I found that I had to write all my own device drivers. Since all my effort over the last few years has been on OS/2 software, the DOS version of OS/2 is a bit dated compared with the OS/2 version, and for example my hard disk driver probably can't handle large disks. However all the basic drivers (screen, keyboard, mouse, floppy) are still workable, and in fact I successfully ported one of my OS/2 programs to DOS (with TopSpeed) only about a week ago. -- Peter Moylan peter at ee dot newcastle dot edu dot au http://eepjm.newcastle.edu.au (OS/2 and eCS information and software) |
|
#5
| |||
| |||
| "Peter Moylan" <peter@seagoon.newcastle.edu.au> wrote in message news:ddgogv$f5q$1@news.newcastle.edu.au... > > [Warning: the domain eepjm.newcastle.edu.au is likely to disappear > without warning some time in the next few months, and my M2 web > pages (which I unfortunately entrusted to another server) have > disappeared already. If you've lost anything in the process you may be able to recover it using the archives in the 'Wayback machine' www.archive.org They have several archives of your pages - the most recent being sometime in 2003. -- Chris Burrows CFB Software http://www.cfbsoftware.com/modula2 |
|
#6
| |||
| |||
| Chris Braid wrote: > In article <ddgeaf$v4n$1@newsm1.svr.pol.co.uk>, > Martin Brown <|||newspam|||@nezumi.demon.co.uk> wrote: > >>Damjan Martic wrote: >> >>>Hi, >>>What does it mean error :"Fatal error os reentered">> >>DOS Found itself running a low level routine that was not reentrant. >>Almost certainly at the lower levels of ReadCard() >>None that you can rely upon. From memory there is a DOSCALL that returns >>a pointer to a BOOLEAN called something like DosCriticalSection. A quick lookup reveals ~INT 21,34~ Get address to DOS critical flag (undocumented) from eg. http://www.cs.chalmers.se/Cs/Grundut...o/Interrup.txt > > As I recall, any calls that do any form of I/O whatever (IO.anything, > FIO.anything, etc) must be bracketed with calls to PROCESS.Lock and > PROCESS.Unlock, otherwise the house of cards comes down. DOS is not > re-entrant. LOCK turns total control of the machine over to the one > single process; the call to Unlock resumes normal time-slicing. In the > end, it all works, but it's pretty 'jerky' when there's a any I/O That tended to be a bit too clunky. Locking only when needed is a lot more efficient (but risky if there are now other gotchas possible with networks etc). Undocumented but it used to work. The last time I did this low level DOS stuff was in the 90's. Regards, Martin Brown |
|
#7
| |||
| |||
| Chris Burrows turpitued: >"Peter Moylan" <peter@seagoon.newcastle.edu.au> wrote in message >news:ddgogv$f5q$1@news.newcastle.edu.au... >> >> [Warning: the domain eepjm.newcastle.edu.au is likely to disappear >> without warning some time in the next few months, and my M2 web >> pages (which I unfortunately entrusted to another server) have >> disappeared already. > >If you've lost anything in the process you may be able to recover it using >the archives in the 'Wayback machine' www.archive.org >They have several archives of your pages - the most recent being sometime in >2003. Thanks for that. I did in fact lose all of my web pages because of a hard disk failure about a year ago, and managed to restore quite a lot of it from the wayback machine. This time it's not a hardware failure, it's a job loss that means I don't get to keep my server at work, but I can back up all the web pages onto CD and restore them once I manage to establish a new server site at home. (Which will, unfortunately, take a long time, because we have a 12-month contract with our existing broadband provider, and I'll have to wait either until it expires, or until I decide that I can afford the penalty for early termination, before I can get a provider that permits servers.) The loss of my M2 web pages - which I discovered only a few days ago - is due to my foolishness in putting them on a computer I don't control. Now that you mention it, I guess there's a good chance of getting them from the wayback machine. -- Peter Moylan peter at ee dot newcastle dot edu dot au http://eepjm.newcastle.edu.au (OS/2 and eCS information and software) |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.