Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!undergrad.cs.ubc.ca!apang From: apang@undergrad.cs.ubc.ca (Anthon 'Amiga' Pang) Newsgroups: comp.sys.amiga.tech Subject: Re: Help - Asynchronous I/O to/from files Message-ID: <1990Mar2.180730.871@undergrad.cs.ubc.ca> Date: 2 Mar 90 18:07:30 GMT References: <99866@linus.UUCP> Sender: root@undergrad.cs.ubc.ca Reply-To: apang@a0 (JVNIc7B7ktKDA) Organization: Computer Science UBC Lines: 25 In article <99866@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes: >My original question was: >> How do I do asynchronous I/O to/from files? > >Someone answered: >> >>Personally, I would have spawned a couple of tasks, which only used the upper >>[much deleted] >I thought that tasks could not access AmigaDOS routines without causing a >guru? (I don't remember where I read this, but I know that in the figures >of the Amiga software architecture in the front of the RKMs Exec is >shown below - used by, not using - AmigaDos.) I know that it is possible to >spawn a coule of _processes_ which can then use the upper level AmigaDOS >routines - but the problem here is that spawning a process requires a >call to LoadSeg - which does a disk access! The whole point of double-buffering >is to speed up disk access by doing input, output, and processing in parallel. Sorry, I should have said "spawned a couple of processes". I used Chris Zamara's "spawn.c" that appeared in AmiTransactor 2.2, which allows you to spawn processes from procedures in your program...no need to LoadSegs here, as the "process" is already in memory along with your main program. It's also pretty efficient when you spawn multiple copies from the same procedure (only 1 copy in memory). I found this easier than DOS packets and a great learning experience--message ports, signals, tasks/processes, assembler, file systems theory...