help me.



If I post in wrong place. forgive me.
I hope some one can Refactor following code for me!
We have a system with 6 application. One application (Named it
ContrlPanel) is a control center, it get command from UI and order
other application do some work. All these application communicate with
each other through share memory. so now all job of ControlPanel is like
following.
1. poll the state of A.
2. according to the state of A order B to do something.
3. poll the state of C.
4. according to the state of C order E or F to do something.
because all this job with share memory need do again and again till
succeed.(try to lock it etc).
so we get some code like following
XXXXThread
{
while (!exit)
{
switch(state) {
case GETING_A_STATE:
if (GetAState()) {
state = DOING_SOMETHING_A;
}
break;
case DOING_SOMETHING_A:
if (DoSomeA()) {
state = GET_C_STATE;
}
break;
case GET_C_STATE:
....
}
}
}

.



Relevant Pages

  • help me.
    ... I hope some one can Refactor following code for me! ... ContrlPanel) is a control center, it get command from UI and order ... each other through share memory. ... poll the state of A. ...
    (comp.object)
  • help me.
    ... I hope some one can Refactor following code for me! ... ContrlPanel) is a control center, it get command from UI and order ... each other through share memory. ... poll the state of A. ...
    (comp.object)
  • Re: help me.
    ... ContrlPanel) is a control center, it get command from UI and order ... each other through share memory. ... poll the state of A. ... So I would try a simpler polling loop: ...
    (comp.object)
  • please help me.
    ... ContrlPanel) is a control center, it get command from UI and order ... each other through share memory. ... poll the state of A. ... this kind of source code make me sick. ...
    (comp.programming.threads)
  • Re: Oracle memory allocation on Linux 2.6
    ... direct I/O should lower memory consumption simply because it ... bypasses buffer cache over which we have no control. ... With Linux, I really have a problem with the ... as well as system administrators are ...
    (comp.databases.oracle.server)