From: Joe Van Dyk Date: 2005-07-13T05:10:16+09:00 Subject: Re: Updating GUIs Hi, I think I tried that approach a while ago. It worked pretty well except with large amounts of Players. If Players get updated 2 times a second and there's 500 players, that would be at least 1000 update calls per second. On 7/12/05, David Brady wrote: > Joe, > > I am looking at this very problem. I don't have any good answers yet, > but to avoid simply saying "me too" to your thread... :-) > > Have you looked at module Observable? For a large number of updatables, > that might reduce your overhead. The Player class would have to call > notify_observers every time it changed, but the end result is that any > GUI update threads would only need to update things that are specific to > the GUI (like a clock or animations). Player updates would be sent > directly to the GUI from the players when they update. > > Ironically, notify_observers calls "update" in the observer. In this > case, the observer would probably want to be the code that controls that > one object in the GUI, not the entire GUI program. > > -dB > > -- > David Brady > ruby-talk@shinybit.com > I'm having a really surreal day... OR AM I? > > >