Path: utzoo!lsuc!ncrcan!brambo!morgan From: morgan@brambo.UUCP (Morgan W. Jones) Newsgroups: comp.sys.amiga Subject: Re: Semicoherent flame about Amigados. Message-ID: <281@brambo.UUCP> Date: 18 Feb 88 00:23:01 GMT References: <644@nuchat.UUCP> <5220@well.UUCP> Reply-To: morgan@brambo.UUCP (Morgan W. Jones) Organization: Bramalea Software Inc., Bramalea, Ont. Lines: 39 In article <5220@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: >In article <644@nuchat.UUCP> peter@nuchat.UUCP (Peter da Silva) writes: >>Finally, I have a suggestion for the multitasking shuffle. Have LoadSeg keep >>a semaphore for each floppy, and single-thread itself. Make Copy respect it. >>And publish how to use it so that we can make our utilities do the same >>thing. > (Motion of hand moving rapidly over head whilst uttering, "Whoosh!") > Huh?? Could you clarify that one; you lost me completely. Semaphores are a mechanism used to ensure that critical portions of code are not executed at the same time by two concurrent tasks. Single-thread means that a given floppy drive is only accessed by one device at a time. So what the whole thing boils down to is that when LoadSeg is asked to load a program, it would lock on a semaphore for the device that it wants to load from (preventing other processes from using the device until LoadSeg is done), loading the program, and then releasing the semaphore. Thus, you would never get two processes trying to access the device at the same time and causing the heads to bump and grind back and forth getting sectors(tracks?). But this really isn't a good idea. It might work fine if all you did was load programs, but it wouldn't do much for accessing data files. Either you would get the bump and grind, or else you would get processes waiting arbitrarily long for I/O because some other program has a semaphore and is processing data. A better solution is to have buffered I/O provided by the operating system where the OS acquires a semaphore on a drive, reads in x number of blocks and then releases the semaphore and lets the program process the data; this would work equally well for both program files and for data files. Then we can all stop trying to arrange our programs so that no two of them try to access drives at the same time. >Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ -- Morgan Jones - Bramalea Software Inc. ...!utgpu!telly \ !brambo!morgan ...!{uunet!mnetor, watmath!utai}!lsuc!ncrcan / "These might not even be my opinions, let alone anyone else's."