|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Oct 27, 2007 8:11 pm
[2.09] MessageQueue problem |
Don't ask me what made made think of doing this, because I have no idea. The problem really only becomes visible when a loop is moved into the background with SHIFT-ESC. You may have adjust the size of the loop make all the effects visible on your system due to speed differences. With this particular test focus keeps leaving and returning to the CMud window, and the longer the loop goes on the longer it takes for each focus cycle.
1. Launch CMud
2. Close Sessions window (ESC)
3. Enter at the command line
Code: |
#LOOP 100 {#MESS {I like being evil}} |
4. While the message windows are popping up press SHIFT-ESC |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sun Oct 28, 2007 6:48 am |
Something very weird definitely happening here. I tried it with 1000 and couldn't do much of anything on the PC for a while.
|
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 29, 2007 10:00 pm |
Well yes, I think it is doing what it's supposed to.
When you use #MESS, you are creating a new window. This window grabs the focus when it is initially displayed. CMUD then takes the focus back to the command line. So each time a new #MESS window is created, it's going to steal the focus for an instant.
Now in 2.09 the routine that puts the focus back to the command line uses a Windows message. And if the message queue is slow to process (like in the base of a background thread running), then it might not be giving focus back immediately like it should.
If someone knows how to create a new popup window without it getting the keyboard focus, let me know.
Otherwise there isn't anything I can do about this. What you are seeing are just the issues of using up windows resources and requiring the background thread to synchronize with the main user interface and to get the focus back to the main command line. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Oct 29, 2007 10:21 pm |
The thing is the focus shifting problem doesn't occur is you don't press SHIFT-ESC, the focus just goes from 1 new message window to the next. Also with a loop of 100 it doesn't much more then then default #MESSAGE time out to complete when you don't hit SHIFT-ESC. When you do SHIFT-ESC then the focus problem appears, and it takes about 30 seconds for that loop to finish on my system. A loop of 500 doesn't become 150 seconds once SHIFT-ESC is used, it was over 15 minutes before I just killed the process.
So I guess the real thing here is more of an optimization where the focus messages don't get all stacked up. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Oct 29, 2007 10:40 pm |
As I mentioned I think, it's because the message to return focus to the command line is still in the Windows message buffer. To prevent a lot of duplicate messages and flickering, CMUD looks in the message queue for an existing "update focus" message and removes any existing message when adding a new message to the end of the queue.
This prevents a lot of extraneous focus messages, but in this case, the update message just keeps getting pushed to the end of the queue where it doesn't get executed until the loop is finished.
But I'll try increasing the loop count...maybe I wasn't using a high-enough number to see the problem. |
|
|
|
|
|