[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problems with depend
From: |
Jan-Henrik Haukeland |
Subject: |
RE: Problems with depend |
Date: |
Wed, 6 Nov 2002 02:31:29 +0100 |
> it's probably an easier and simpler way to
> solve this than to bring in Dijkstra and advanced graph algorithms.
I think that the algorithm can be kept simple, at least when I think about it
now late at night. The enclosed diagram shows the set-up. The diagram shows
first a dependency list, then the standard process list and finally a matrix
where the dependency list is combined with the process list. This is the
current data structure we already have. To start all processes in a dependant
order and not start or stop processes twice the following algorithm can be
used:
for each process in the process list (This is the standard for-loop in
validate.c)
if process is marked as visited then
continue;
else
again:
if process has a depend list $
for each process in the depend list; @
if process is marked then error("Got Loop");
else goto again;
else begin
start/stop process;
mark process as visited;
end
That's basically it, the loop marked with @ must be recursive in that the
search is done for the process without a depend list then backtrack and
start/stop each process as we go back to the original process in the line
marked with $.
I think this should work (with some work), what do you think?
my $0.002 late at night
Jan-Henrik
depend.gif
Description: GIF image
- Problems with depend, Jan-Henrik Haukeland, 2002/11/05
- Re: Problems with depend, rory, 2002/11/05
- Re: Problems with depend, Jan-Henrik Haukeland, 2002/11/05
- Re: Problems with depend, Rory Toma, 2002/11/05
- Re: Problems with depend, Jan-Henrik Haukeland, 2002/11/05
- Re: Problems with depend, Rory Toma, 2002/11/05
- RE: Problems with depend,
Jan-Henrik Haukeland <=
- RE: Problems with depend, Rory Toma, 2002/11/06
- Re: Problems with depend, Jan-Henrik Haukeland, 2002/11/07
- Re: Problems with depend, Rory Toma, 2002/11/07
- Re: Problems with depend, Rory Toma, 2002/11/08
Re: Problems with depend, Rory Toma, 2002/11/05