Board index » delphi » multiple DOS box 'interference'

multiple DOS box 'interference'

Hello All!

Using TP6 and Win 3.1, writing an app for use by Pegasus as 'run a
program' via filter.

Also using Jack Ridgway's MulAware tpmul400 in this and several other
programs, folks using it under various OSs say it cleared up many
problems.

A single instance of Pmail 'run a program' works just fine, perfect..
Problem arises when Pmail calls more than one instance of the program.
DOS windows hang, others fail to complete tasks, it's a mess.

My first inclination was to create a flag file and have other
instances loop until the flag goes away, but the impression I get is
that it just isn't fast enough, as soon as the flag is deleted all
instances attempt to create a new one and there is conflict.

My second inclination would be an environment variable. That would be
fast enough, but I don't know how to permit multiple DOS boxes to
communicate via a 'global' type variable, and I'm pretty sure there's
still the potential for conflict.

I've been through the SWAG but don't see anything that seems to apply.

Question is, can you point me towards a faq or sample prog that
describes how to prevent the conflicts.

Or, is there a PIF setting that might straighten it out.

Or, is there something in SWAG that I've simply missed.

Other problem possibly related to PIF is the major screen flashing and
clacking my monitor goes through opening and closing DOS windows, is
there any way to kill that effect?

A 'Windows' compiler is -not- something I want to deal with, this is
far too simple a program to need anything that excessive, IMO.

Thanks much. Have a :) day!

--
jim barchuk
mailto:jbarc...@worldnet.att.net
http://www.10mb.com/jbarchuk/

 

Re:multiple DOS box 'interference'


In <3307551e.10294...@netnews.worldnet.att.net>, jbarc...@worldnet.att.net (jim barchuk) writes:

Quote
>Hello All!

>Using TP6 and Win 3.1, writing an app for use by Pegasus as 'run a
>program' via filter.

>Also using Jack Ridgway's MulAware tpmul400 in this and several other
>programs, folks using it under various OSs say it cleared up many
>problems.

>A single instance of Pmail 'run a program' works just fine, perfect..
>Problem arises when Pmail calls more than one instance of the program.
>DOS windows hang, others fail to complete tasks, it's a mess.

>My first inclination was to create a flag file and have other
>instances loop until the flag goes away, but the impression I get is
>that it just isn't fast enough, as soon as the flag is deleted all
>instances attempt to create a new one and there is conflict.

This is probabily the simplest way to do it.  What you're proposing is
called a file semaphore.  You'll probabily need to create an edge triggered
one for your purposes.  Using a file is the simplest method considering you're
using DOS boxes.

Quote

>My second inclination would be an environment variable. That would be
>fast enough, but I don't know how to permit multiple DOS boxes to
>communicate via a 'global' type variable, and I'm pretty sure there's
>still the potential for conflict.

I'm not sure about windows, but if you're running in a protected mode
operating system, like I am with OS/2, you may not be able to do this
in a DOS box.  The operating system wouldn't like it.  OS/2 on the other
hand would allow this in a shared segment.  In your case, I'd look to your
first solution as the best way to accomplish this.

[Clip]

Happy programming,

Paul.

Re:multiple DOS box 'interference'


Hello Paul!

Quote
>>>>Using TP6 and Win 3.1, writing an app for use by Pegasus as 'run a
>>program' via filter.
>>A single instance of Pmail 'run a program' works just fine, perfect..
>>Problem arises when Pmail calls more than one instance of the program.
>>DOS windows hang, others fail to complete tasks, it's a mess.
>This is probabily the simplest way to do it.  What you're proposing is
>called a file semaphore.  

What I finally ended up doing, didn't want to because I hate dealing
with FindFirst and FindNext, was put up one semaphore and all
successive instance simply immediately shut down. That first instance
delas with everything it can find. This is actually a better way to
go, have no idea 'how many' instances might be called, and too many
could blow the system.

Thanks much. Have a :) day!

--
jim barchuk
mailto:jbarc...@worldnet.att.net
http://www.10mb.com/jbarchuk/
http://www.thesurvey.com

Re:multiple DOS box 'interference'


Quote
jbarc...@worldnet.att.net (jim barchuk) wrote:
>Hello All!
>Using TP6 and Win 3.1, writing an app for use by Pegasus as 'run a
>program' via filter.

[...]

Quote
>A single instance of Pmail 'run a program' works just fine, perfect..
>Problem arises when Pmail calls more than one instance of the program.
>DOS windows hang, others fail to complete tasks, it's a mess.

[...]

Quote
>A 'Windows' compiler is -not- something I want to deal with, this is
>far too simple a program to need anything that excessive, IMO.
>Thanks much. Have a :) day!
>--
>jim barchuk
>mailto:jbarc...@worldnet.att.net
>http://www.10mb.com/jbarchuk/

I use a window-less Windows program coded in BPW something like this:-

program ProcessMsgFile;

uses WinTypes, WinProcs, Strings;

Var St: String;

Function .... ;

begin
....
end;

procedure WinMain;
type String128 = string[128];  etc

var .....

Procedure Process;
Var  ..... ;

begin
......
end; {Process }

begin
  Process;
.........
  Messagebeep(MB_ICONHAND);
  Halt(255);
end;

begin
  WinMain;
end.

The Pegasus Mail rule is triggered on some text. Action is run a
program, in this case,  ProcessMsgFile, written as above. Its a bit
noisy, but you can cut out the messagebeep() line if you want. Its the
shortest Windows program I've ever written!

regards

Michael Glover
(Surrey, UK. glo...@globalnet.co.uk)
http://www.globalnet.co.uk/~glover/

Other Threads