view Design_Notes.txt @ 4:c87e1925f7b2

works, with test app sending in a chain, in mult-threaded mode
author Sean Halle <seanhalle@yahoo.com>
date Sat, 25 Aug 2012 12:22:21 -0700
parents 7a85919442f2
children 1c9122bfd1c8
line source
1 0x7ffff644ab60
2 0x7ffff64487f0
3 0x7ffff644b0a0
5 This test app has to exercise all the aspects of the request handling
6 and the assigner code.
8 The assigner has two different Qs, plus a set of currentTaskSlvs check for tasks and also check for explicit VPs.
10 So, in the app, make tasks, and also explicit VPs.. create such that they
11 interleave, cause assigner to switch between.
13 So, when start, make some tasks, then make some explicit VPs, then some
14 tasks, back and forth.. second batch of tasks have inter-dependencies, so
15 some of the VPs should jump into the middle of them..
17 Then, make it so that the last two tasks talk to each other, suspending
18 each other in turn, (which should cause the extra VPs to dissipate) and
19 after that they create a bunch more tasks.
21 Okay.. what needs to be exercised?
22 -] create new slave when task suspends
23 -] dissipate extra slave when have a task one, and no free tasks
24 -] suspend a task -> no tasks in taskQ -> empty task slave in slaveQ ->
25 dissipate that task slave -> explicit slave next in slaveQ, animate that.
26 Means: To get an empty task slave in slaveQ -> create a task that will
27 suspend, then create a normal task, which will cause an extra task
28 slave to be created
30 ===================
31 To have explicit VPs as well tasks.. add a field to semantic data holds type
32 of VP: whether it's for running tasks, vs an explicit VP. when an
33 explicit dissipates, then switch it to a task VP that has no suspended
34 tasks..
36 So, in the semantic data, have:
37 -> taskVP vs explicitVP
38 -> has suspended task vs idle
40 Then fix the assigner logic:
41 When task suspends, get next readyVP,
42 check if it's an explicit
43 and if yes, resume it,
44 if no, then it's a taskVP, so get next task from taskQ and do it.
45 Check whether taskQ empty
46 if yes, then in the state: suspended taskVP, have empty taskVP, no tasks
47 so,
49 If taskQ empty, and VP Q empty, return NULL, which will trigger the
50 back-to-back Master backoff.
52 If assigner called and no suspended slaves and taskQ empty.. does it have
53 a "current task slave"? If not, create one in the semantic Env.
54 ==================================