Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: comp.sys.amiga.programmer Subject: SCMD_SETPARAMS problem -- catch-22? Message-ID: <7649@jhunix.HCF.JHU.EDU> Date: 26 Feb 91 04:51:46 GMT Distribution: usa Organization: The Johns Hopkins University - HCF Lines: 39 I have written a MIDI program that opens the serial port in shared mode. I would like to allow this program to be run multiple times simultaneously. The program can be used for reading or writing MIDI, but not both. (Which is why I want multiple copies to be run.) However, the SCMD_SETPARAMS command (to set baud rate, etc.) will fail if another process has any pending reads on the serial port. This is a problem if I try to run several copies of my program! The SCMD_SETPARAMS fails on the invocation of the second copy. So here's the question. How can I have a program that is watching the serial port for reads, and still start up a second program that needs to execute SCMD_SETPARAMS? Or is there another way to accomplish what SCMD_SETPARAMS does? I am doing this: Midi->io_SerFlags = SERF_RAD_BOOGIE; Midi->io_Baud = MIDI_BAUD_RATE; Midi->io_ExtFlags = 0; Midi->IOSer.io_Command = SDCMD_SETPARAMS; if (DoIO((struct IORequest *)Midi) != 0) Error(...); Of course I don't want two different trying to read the serial port at once. But I would like to have a "reader" and "writer" program existing simultaneously. The only way I can do it now is to run the "writer" program first (no pending writes) and then the "reader". I don't want to be forced to run these programs in any particular order. Thanks for any advice. Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////