[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problems with depend
From: |
Rory Toma |
Subject: |
RE: Problems with depend |
Date: |
06 Nov 2002 17:59:35 -0800 |
I've almost got this done. It looks like I can probably do it by only
adding about 10-15 lines of code to validate.c. (hopefully) 8-)
Hopefully, I'll have something to test tomorrow.
On Tue, 2002-11-05 at 17:31, Jan-Henrik Haukeland wrote:
> > 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
--
Rory Toma address@hidden
VP of Run Level 5 http://www.trs80.net
Digeo Digital http://www.digeo.com
signature.asc
Description: This is a digitally signed message part
- 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, 2002/11/05
- RE: Problems with depend,
Rory Toma <=
- 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