Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Throw away the dispatcher 'skipList' and give Step a state. (http://www.linux-archive.org/debian-kernel/526837-throw-away-dispatcher-skiplist-give-step-state.html)

Martin Sivak 05-16-2011 12:28 PM

Throw away the dispatcher 'skipList' and give Step a state.
 
----- Original Message -----
> In particular, 'scheduled' will run if not explicitly skipped,
> 'skipped'
> means 'is never going to be run' and 'requested' means 'will run and
> can
> not be skipped'.
> ---

> -
> class Step(object):
> + SCHED_UNSCHEDULED = 0
> + SCHED_SCHEDULED = 1 # will execute if not explicitly skipped
> + SCHED_SKIPPED = 2 # is never going to execute
> + SCHED_REQUESTED = 3 # will execute and can not be skipped
> + SCHED_DONE = 4 # done is a final state
> +
> + sched_state_machine = [
> + # unscheduled # scheduled # skipped # requested # done
> + [SCHED_UNSCHEDULED, SCHED_SCHEDULED, SCHED_SKIPPED, SCHED_REQUESTED,
> SCHED_DONE], # unscheduled
> + [None , SCHED_SCHEDULED, SCHED_SKIPPED, SCHED_REQUESTED,
> SCHED_DONE], # scheduled
> + [None , None , SCHED_SKIPPED, None , None], # skipped
> + [None , None , None , SCHED_REQUESTED, SCHED_DONE], # requested
> + [None , None , None , None , SCHED_DONE]] # done
> +

This really deserves much better documentation. If it specifies the matrix of allowed transitions, is column or row the starting point? Why didn't you use True/False (or True/0 to make it more visible) to mark the valid transition edges, or is there any meaning in the transition value?

--
Martin Sivák
msivak@redhat.com
Red Hat Czech
Anaconda team / Brno, CZ

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Ales Kozumplik 05-17-2011 01:52 PM

Throw away the dispatcher 'skipList' and give Step a state.
 
On 05/16/2011 02:28 PM, Martin Sivak wrote:


This really deserves much better documentation. If it specifies the matrix of allowed transitions, is column or row the starting point? Why didn't you use True/False (or True/0 to make it more visible) to mark the valid transition edges, or is there any meaning in the transition value?



I will really give it one. And you're right I am going to simplify this
by using True/False, the value was not really used (except by testing to
be None).


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 02:54 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.