Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #522
| From | Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Task Obey madness |
| Date | 2011-07-05 22:15 +0100 |
| Message-ID | <mpro.lnvpqa00477xq02sc@wingsandbeaks.org.uk.invalid> (permalink) |
| References | <6353b0ed51.martin@blueyonder.co.uk> |
Martin Bazley <martin.bazley@blueyonder.co.uk> wrote: > This is a most peculiar set of symptoms which I've never experienced > before a couple of weeks ago, but which I've now experienced on both RO5 > and RO6. > > I have a command-line BASIC program which converts from one file format > to another. In the process it opens two more, temporary, files in the > same directory as the output, which it deletes when the process is > complete. (It's been a while since I did any RO programming so some of this reply could be tosh.) Something that's not entirely clear to me... presumably the basic program does not itself multitask? Do those temporary files have fixed names? If so, running two of these things in parallel against the same output directory would be a problem. If I was doing this I'd dynamically create such leafnames using something like a microsecond-accurate timestamp, and even then there might be a clash. > I batch-convert a lot of files in one go by means of a Task > Obey script, which does not produce any VDU output. This normally runs > as expected. However, sometimes it doesn't... > > Very occasionally, the Task Obey will stop partway down with a "This > file is already open" error. The cause is random, and certainly not > caused by any open files. When you get that error do you then use a standalone utility to list all the open files? If not, how can you be so sure that the OS is wrong? > The last time it happened, I was running two different Task Obeys at once, I've never completely understood on what basis a Task-anything multitasks, but I have some distant feeling that it requires (text) output to the task window. Is that rubbish? Does running a Task-Obey cause the taskwindow server to front-end any SWIs? > outputting into different directories and getting input from the same > directory, but this shouldn't have made a difference, as input-only files > are allowed to be opened any number of times, and all I was doing was one > call to OS_File 16. It's also occurred when I was only running one > instance. > What happens next seems equally random. On one occasion, immediately > after giving the error, the Task Obey then skated drunkenly down all the > remaining star-commands in the file, executed about 30% of them > completely at random, and then forcibly terminated them all, leaving a > large assortment of temporary files still open. I cannot possibly > imagine what could have caused this unique and demented behaviour. I wonder if a reporter log showing these *commands being executed/skipped would help? Presumably normally if your basic program was failing it would issue *ERROR... and that would flush the rest of the Obey file. Does that mean that *ERROR didn't get executed? > Now, let's get one thing quite clear. The Task Obey does not open any > files. The Task Obey is nothing more than a list of start-commands, all > calling the BASIC file for different input values (via an alias to take > out the repetitive bits). Whenever I've used a BASIC program like this I've preceded its start by setting a system variable to a default "something went wrong running the program" error message, and within the program only as the very last thing done if it's run ok, reset that var to "OK". Then in the Obey file I've checked the var had the "OK" value. But that wouldn't work if you had more than one such Obey file running in parallel because they'd be hitting the same sysvar name. One would need to be more creative... > All OPENOUT commands are in the BASIC file, and quite deep within the > BASIC file at that. In order to open each two of those temporary files, > the Task Obey must have executed each of its remaining lines, processed > the alias, and called the BASIC file with the correct parameters for each > one. For "each one"? Must it? Surely the TO causes one BASIC program to run, waits for it to complete, then goes on to the next set of commands? > The BASIC file must then have validated its parameters, loaded the > input file into memory, interpreted and generated quite a large number of > complex data structures, done an entire first pass over most of the input > data to define variable limits, and DIMensioned an ungodly number of > arrays, before it even got close to the output procedure in which the two > temporary files were created. So what? If you're multitasking two of these task-obeys they could get to this point at the same time. Does your program check return codes from everything? > (The final files, which didn't appear, are left until after the temporary > files are finished.) And since it isn't that long after the creation that > the first bytes of output are written, the Task Obey must have seeked > through the whole (not inconsiderable) initialisation process until it > discovered two OPENOUT commands, Umm, in how much of what precedes this did you mean BASIC when you said Task Obey? > What caused this? I do not have a clue. It is the single most bizarre > thing I have observed RISC OS do, and in my time as a programmer, I've > seen it do many. Why are these Task Obey files not just simple Obey files? > Furthermore, does anyone have any idea what may cause a program to throw a > "This file is already open" error for no reason at all? Nope but I'd need convinced there was no reason. -- Jeremy C B Nicoll - my opinions are my own. Email sent to my from-address will be deleted. Instead, please reply to newsreplyaaa@wingsandbeaks.org.uk replacing "aaa" by "284".
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Task Obey madness Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-07-04 21:44 +0100
Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-04 22:35 +0100
Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 08:07 +0200
Re: Task Obey madness Rob Davison <nospamthanks@invalid.invalid> - 2011-07-05 19:59 +1200
Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 10:28 +0200
Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 12:08 +0200
Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 11:36 +0100
Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 12:43 +0200
Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 12:51 +0200
Re: Task Obey madness Ian Hamilton <Ian.Hamilton@AAUG.net> - 2011-07-05 12:03 +0100
Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 13:32 +0200
Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 12:57 +0100
Re: Task Obey madness "John Williams (News)" <UCEbin@tiscali.co.uk> - 2011-07-05 14:17 +0200
Re: Task Obey madness Paul Sprangers <Paul@sprie.nl> - 2011-07-05 14:39 +0200
Re: Task Obey madness Vince M Hudd <vinceh@softrock.co.uk> - 2011-07-05 12:22 +0100
Re: Task Obey madness Rob Davison <nospamthanks@invalid.invalid> - 2011-07-06 08:27 +1200
Re: Task Obey madness Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-07-06 08:15 +0200
Re: Task Obey madness jgharston <jgh@arcade.demon.co.uk> - 2011-07-06 18:48 -0700
Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-07 13:55 +0100
Re: Task Obey madness Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-07-12 20:07 +0200
Re: Task Obey madness cferris@freeRemoveuk.com.invalid - 2011-07-05 09:09 +0100
Re: Task Obey madness Steve Drain <steve@kappa.me.uk> - 2011-07-05 10:19 +0100
Re: Task Obey madness Martin Bazley <martin.bazley@blueyonder.co.uk> - 2011-07-05 12:40 +0100
Re: Task Obey madness Martin <News03@avisoft.f9.co.uk> - 2011-07-05 16:19 +0100
Re: Task Obey madness Alan Adams <alan@adamshome.org.uk> - 2011-07-05 17:31 +0100
Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-06 12:35 +0100
Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-07 13:57 +0100
Re: Task Obey madness Alan Adams <alan@adamshome.org.uk> - 2011-07-07 21:18 +0100
Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-13 12:36 +0100
Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-14 15:58 +0100
Re: Task Obey madness Ian Hamilton <Ian.Hamilton@AAUG.net> - 2011-07-14 16:10 +0100
Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 12:30 +0100
Re: Task Obey madness "Ste (news)" <steve@revi11.plus.com> - 2011-07-17 14:23 +0100
Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 16:14 +0100
Re: Task Obey madness druck <news@druck.org.uk> - 2011-07-14 19:23 +0100
Re: Task Obey madness Ian J Hartley <Ian.Hartley@sky.com> - 2011-07-17 14:17 +0100
Re: Task Obey madness Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-07-05 22:15 +0100
Re: Task Obey madness Rainer Schubert <dl6hbo@dl6hbo.inka.de> - 2011-07-08 17:14 +0200
csiph-web