Home Register Arcade Gallery Chatroom Members Today's Posts Log In
Go Back   Inside: SereneScreen Fan Forum > SereneScreen Products > Marine Aquarium 3 for Windows
Notices

Reply
 
Thread Tools
Old 05-21-2010, 11:00 PM   #1
Ralph
Retired
 
Ralph's Avatar
 
Join Date: Jan 2002
1 Highscore

Location: Edmonton Alberta Ca
Posts: 2,443
Beta 11f multiple monitor bug

During the process of providing John some screen shots of multiple monitor setups I think I may have found a new bug. At one time it was possible to run multiple copies of the same beta. Jim fixed that but... trying to run a second instance now... creates problems.
In full screen mode there is no problem as it is impossible to start a second application. But in a windowed mode.. an attempt at starting the second instance brings up the splash screen on the second monitor and can only be removed by stopping the original instance.
The splash screen occasionally is a segmented full screen display but the display settings do not seem to directly influence it and at other times it is just a black screen. Right clicking on that second monitor brings up an option to go full screen which seems to work
Ralph is offline   Reply With Quote
Old 05-22-2010, 12:03 AM   #2
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
Are you clicking on the same icon or filename to start the second instance?
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Old 05-22-2010, 02:49 AM   #3
cjmaddy
Registered
 
cjmaddy's Avatar
 
Join Date: Nov 2001

Location: Lancashire, UK
Posts: 7,854
The best solution, (assuming it's simple to implement! ), might be to prevent any second window instance, if a window is already running?

I can partly confirm Ralph's experience. (Though I didn't see the splash screen). - Yes, I did click on the same desktop icon for the second instance.

This is not common only to 11f. The same also applies to the official 10d. - Exiting closes both instances.
cjmaddy is offline   Reply With Quote
Old 05-22-2010, 08:24 AM   #4
Ralph
Retired
 
Ralph's Avatar
 
Join Date: Jan 2002
1 Highscore

Location: Edmonton Alberta Ca
Posts: 2,443
Originally posted by Jim Sachs:
Are you clicking on the same icon or filename to start the second instance?  
Yes
Ralph is offline   Reply With Quote
Old 05-22-2010, 09:35 AM   #5
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
All versions of Marine Aquarium have used a technique called a Mutex, which is SUPPOSED to prevent a copy of the program from starting if another is already running. Somehow, you guys are able to get around this, but in looking through (Edgar's) code, I don't see how. The reason I asked if the same icon was being used to start the program is that the Mutex uses the internal name of the program to see if it's the same one that's already running. Previous versions, Beta versions, etc. have different internal names, so they would not be prevented from starting.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Old 05-22-2010, 10:25 AM   #6
Dale
Banned
 
Join Date: Jun 2005

Location: Western Missouri
Posts: 960
Originally posted by Jim Sachs:
... the Mutex uses the internal name of the program to see if it's the same one that's already running. Previous versions, Beta versions, etc. have different internal names, so they would not be prevented from starting.  
How do we see the internal name of the program?

Is it possible that this Mutex doesn't work with .scr files? Perhaps depending on the version of Windows being used?
Dale is offline   Reply With Quote
Old 05-22-2010, 10:31 AM   #7
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
It definitely works here. Putting in breakpoints in my debugger, I can watch as a new instance finds an old instance running and shuts down.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Old 05-22-2010, 01:33 PM   #8
Ralph
Retired
 
Ralph's Avatar
 
Join Date: Jan 2002
1 Highscore

Location: Edmonton Alberta Ca
Posts: 2,443
From yesterdays observations.. it seems that the second instance is related to the settings in the display panel. Where there are instructions to use or not use the second monitor, the second instance (possibly the same instance but asked to do it over??) finds these instructions confusing and thus the various displays I noted yesterday. From showing the splash screen to a black screen to segments of my wallpaper showing through a black screen.
Ralph is offline   Reply With Quote
Old 05-22-2010, 02:15 PM   #9
Dale
Banned
 
Join Date: Jun 2005

Location: Western Missouri
Posts: 960
Ralph; what version of Windows (I'm told that Mutex works slightly differently in Windows 7).

Originally posted by Jim Sachs:
All versions of Marine Aquarium have used a technique called a Mutex, which is SUPPOSED to prevent a copy of the program from starting if another is already running. Somehow, you guys are able to get around this, but in looking through (Edgar's) code, I don't see how. .  
Of course, I can't see the code. Presumably you know that a Mutex, by itself, does not prevent a copy of the program from starting -- a Mutex is a mechanism for coordinating (synchronizing) the sharing of resources. Some additional code would be required for the 2nd copy to "commit suicide" if it can't get the resource. At least that's how it normally is coded.

That's not the "intended use" of Mutex (detecting when a program should kill itself). When it works, it works fine - but Mutex implementation can change when operating systems change, and also the "right" way for a program to commit suicide may be different between operating systems.

Of course, I'm making some really broad assumptions about how this is coded. In particular, I'm assuming that it's the responsibility of the "2nd copy" to detect the "problem" and commit suicide.
Dale is offline   Reply With Quote
Old 05-22-2010, 02:48 PM   #10
Ralph
Retired
 
Ralph's Avatar
 
Join Date: Jan 2002
1 Highscore

Location: Edmonton Alberta Ca
Posts: 2,443
My system is running Windows XP SP3
Ralph is offline   Reply With Quote
Old 05-22-2010, 03:21 PM   #11
cjmaddy
Registered
 
cjmaddy's Avatar
 
Join Date: Nov 2001

Location: Lancashire, UK
Posts: 7,854
My belief is that this second-instance problem only occurs where there is a secondary monitor present. It isn't possible for me to completely simulate only having one monitor because MA3 still thinks that there are two screens, due to Windows seeing a Dual DVI-out Video card and therefore MA3 still shows two Monitor tabs in the MA3 Display Settings, even when one monitor connecting lead has been completely removed. And under those conditions, opting to 'Display nothing on this monitor', does not have the desired effect of simulating only having one screen.

It isn't really a problem. I'm confident that it wouldn't happen on a singe monitor setup, and why would we want to re-select the same app a second time?

I say, live with it. - Put it down to the joys of having multiple-monitors! - There are other more important considerations that we need to be aware of when running dual-screens.....

As I've reported in the past, it should be pointed out that the FPS will drop dramatically if any part of a window is allowed to extend onto the second monitor. ie: The window must be contained within the 'Primary' monitor only, - if the expected FPS are to be maintained.

Also, which monitor is to be chosen as the Primary, (and how it is chosen), is another important but thorny subject that has also been covered on a number of occasions.
cjmaddy is offline   Reply With Quote
Old 05-22-2010, 03:27 PM   #12
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
Yes, I'll probably ignore the dual-instance issue for this release. Without being able to duplicate it, anything I would try would be a complete shot in the dark. Could take weeks to track down that way, if ever.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Old 05-22-2010, 03:39 PM   #13
Ralph
Retired
 
Ralph's Avatar
 
Join Date: Jan 2002
1 Highscore

Location: Edmonton Alberta Ca
Posts: 2,443
Fair enough... possibly we can try to pin it down with the next release. As Cliff states this is not a big deal and one should not try to run two instances anyway.
Ralph is offline   Reply With Quote
Old 05-22-2010, 03:55 PM   #14
cjmaddy
Registered
 
cjmaddy's Avatar
 
Join Date: Nov 2001

Location: Lancashire, UK
Posts: 7,854
Agreed! .... Don't do it, Jim.... Don't even think about it!

If you try to cover the setup of Dual-Monitors to include all situations of Widows OS, different video cards, different driver settings, different screen sizes/resolutions, and the multitude of different settings in different places..... You will not only open-up a very large can of worms, - but you will probably get the mother of all headaches!
cjmaddy is offline   Reply With Quote
Old 05-22-2010, 03:59 PM   #15
JohnWho
Registered
 
JohnWho's Avatar
 
Join Date: Sep 2009

Location: Tampa Bay Area, Florida
Posts: 486
I agree as well.

MA appears to work in some manner on most, if not all, multi- monitor systems.

If one has such a system, enjoy it as best as you can.

Although, a "very large can of worms" might feed our fish for a long time!

I know you think you understand what you thought I said,
but I'm not sure you realize that what you heard is not what I meant!
JohnWho is offline   Reply With Quote
Old 05-23-2010, 02:43 AM   #16
feldon34
Forum Administrator
 
feldon34's Avatar
 
Join Date: Dec 2000

Location: Rock Hill, SC
Posts: 10,939
In my programming experience, I checked to see if another program was running on the computer with the same internal program name. Never heard of a Mutex.
"Journalism is printing what someone else does not want printed. Everything else is public relations." - George Orwell
"If voting changed anything, they'd make it illegal." - Emma Goldman
feldon34 is offline   Reply With Quote
Old 05-23-2010, 11:09 AM   #17
Dale
Banned
 
Join Date: Jun 2005

Location: Western Missouri
Posts: 960
Originally posted by feldon34:
In my programming experience, I checked to see if another program was running on the computer with the same internal program name. Never heard of a Mutex.  
Think of Mutex as "Mutual Exclusion"

Assume there is a critical resource (serially-reusable but non-reentrant) that is needed by two or more programs. Those programs do not need to be doing the same tasks, and do not need to have the same program name - they just need exclusive use of the resource for a while.

Each of the several programs will get access to the critical resource by issuing a Mutex.

The effect is like each program asked the system: "Please give me access to this resource, and if you can't do that right now, then put me in a queue (in request order with everybody else who wants that resource), and suspend my execution until I can have that resource.

Mutex is not normally/generally/usually used in the way MA3 is apparently using it: "Give me that resource right now, or I intend to commit suicide".

Footnote: Not that it makes any difference, but it's also not clear what "resource" MA3 is looking at.
Dale is offline   Reply With Quote
Old 05-23-2010, 12:41 PM   #18
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
In this case, the Mutex IS the resource. MA3 attempts to create a Mutex called Marine Aquarium 3. If the call fails because one already exists, the program exits.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Old 05-23-2010, 12:55 PM   #19
Dale
Banned
 
Join Date: Jun 2005

Location: Western Missouri
Posts: 960
Originally posted by Jim Sachs:
In this case, the Mutex IS the resource. MA3 attempts to create a Mutex called Marine Aquarium 3. If the call fails because one already exists, the program exits.  
That precisely explains why it doesn't work sometimes.

Thanks for the clarification.
Dale is offline   Reply With Quote
Old 05-23-2010, 02:20 PM   #20
Jim Sachs
Developer
 
Jim Sachs's Avatar
 
Join Date: Dec 2000

Location: Southern Oregon
Posts: 9,791
Using a Mutex is a very common way to prevent a second instance of a program from opening.
Jim Sachs
Creator of SereneScreen Aquarium
Jim Sachs is offline   Reply With Quote
Reply
Go Back   Inside: SereneScreen Fan Forum > SereneScreen Products > Marine Aquarium 3 for Windows




Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


All times are GMT -6. The time now is 04:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.