Bug 1788 - replace requestRefresh() with Host.requestAddRefreshObserver
Summary: replace requestRefresh() with Host.requestAddRefreshObserver
Status: ASSIGNED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
: 4310 (view as bug list)
Depends on: 1859 2249 2250 1631 4310
Blocks: 2081
  Show dependency treegraph
 
Reported: 2005-11-02 18:58 UTC by Phil Muldoon
Modified: 2007-04-02 19:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Muldoon 2005-11-02 18:58:47 UTC
pmuldoon -> cagney, how evil would it be (and is it possible to have a
requestRefresh(boolean block) (ie make in not asynch)

cagney -> pmuldoon, pretty evil, whats the problem?

pmuldoon -> cagney, the initial population of the tree takes take a bit, and one
of the things we were pondering is to hide the gui until the requestRefresh() is
complete (so the treeview does not draw itself 100s of time on the initial
population of all Procs and Tasks)

cagney -> pmuldoon, so you need to know when a refresh has completed?

pmuldoon => Right now we don't know when requestRefresh is complete because of
it's async nature (which is why you see the GUI start up blank for a few seconds)

pmuldoon -> cagney, yep

cagney -> pmuldoon, that's more straight forward and on the todo- list - all the
observers should behave like the current task ones

pmuldoon -> cagney, well good ;) I like when I ask for something you've already
thought about it/done it/will do it ;)

cagney -> pmuldoon, not quiete put right; I think the gui should be able to
register a host observer requesting refreshes at a specific rate; and get
notified when it is starting / finishing.

pmuldoon -> cagney, yes the starting and finishing would be good to sync up.
Right now it is a cosmetic problem on startup (ie blank and unresponsive gui on
startup due to lots of tree updates for each ProcCreated observable)

pmuldoon -> cagney, what we do in the future is wait on the finish event, then
do mainWindow.showAll(). That solves the repeated treeview redraws on initial
startup 

pmuldoon s/That solves/That would solve

cagney -> pmuldoon, sounds right; the same would apply to updates - on a rapidly
changing system the updates should only be pushed at the end

cagney -> pmuldoon, can you bug report this?

pmuldoon -> cagney, I'm not sure how to word it. Request a finish observer for
requestRefresh()?

pmuldoon -> I can do that as the title, then copy this irc log to there?

cagney -> replace requestRefresh() with Host.requestAddRefreshObserver
Comment 1 Andrew Cagney 2005-11-10 16:54:58 UTC
well I guess there is kind of good news; I've figured out how to do this (also
for Task.requestAddXxxObserver).  For every observable:observer pair there is
now an Observation object.  The synchronized version could block on that object,
and then when the core has finished processing, unblock it vis:

xxxx()
   Observation o = new observation (....)
   send observation to event loop
   return o.wait ()
   
  The only restriction is that the method not be called by the EventLoop thread
- instant deadlock.

Having this will also likely make scripts easier vis:

main ()
{
  Host = new LinuxHost ();
  host.refresh ();
  for (task in host.getTasks ())
    task.so something;
}

of course this isn't an ok for the gui, that needs to be more agressive and use
the async mechanisms.
Comment 2 Andrew Cagney 2006-01-31 18:02:17 UTC
Mark old mechanism as dead:

Index: frysk-core/frysk/bindir/ChangeLog
2006-01-31  Andrew Cagney  <cagney@redhat.com>

        * ftrace.java: Update, use renamed observableProcAddedXXX, and
        observableProcRemovedXXX.

Index: frysk-core/frysk/proc/ChangeLog
2006-01-31  Andrew Cagney  <cagney@redhat.com>

        * Host.java (observableProcAddedXXX): Rename observableProcAdded.
        (observableProcRemovedXXX): Rename observableProcRemoved.
        (observableTaskAddedXXX): Rename observableTaskAdded.
        (observableTaskRemovedXXX): Rename observableTaskRemoved.
        * Proc.java: Update.
        * TestI386Modify.java: Update.
        * TestI386Regs.java: Update.
        * TestLib.java: Update.
        * TestModify.java: Update.
        * TestRefresh.java: Update.
        * TestSyscall.java: Update.
        * TestSyscall2.java: Update.
        * TestSyscallInterrupt.java: Update.
        * TestSyscallOpen.java: Update.

Index: frysk-gui/frysk/gui/monitor/ChangeLog
2006-01-31  Andrew Cagney  <cagney@redhat.com>

        * ProcDataModel.java: Update, use renamed observableProcAddedXXX,
        and observableProcRemovedXXX.
Comment 3 Andrew Cagney 2006-02-02 03:11:28 UTC
Index: frysk-core/frysk/proc/ChangeLog
2006-02-01  Andrew Cagney  <cagney@redhat.com>

        * Host.java (requestRefreshXXX(boolean)): Rename requestRefresh.
        (requestRefresh()): Delete.
        * TestSyscallInterrupt.java: Update.
        * TestRefresh.java: Update.
        * TestLib.java: Update.

Index: frysk-gui/frysk/gui/monitor/ChangeLog
2006-02-01  Andrew Cagney  <cagney@redhat.com>

        * ProcDataModel.java: Update, use .requestRefreshXXX instead of
        .requestRefresh.
Comment 4 Andrew Cagney 2007-04-02 20:32:39 UTC
*** Bug 4310 has been marked as a duplicate of this bug. ***