labscript-suite-temp-2 / blacs

BLACS, part of the labscript suite, provides an interface to hardware used to control a buffered experiment. It manages a queue of shots to be run as well as providing manual control over devices between shots.
Other
0 stars 0 forks source link

AppID stuff not set correctly after compile and restart #5

Open philipstarkey opened 9 years ago

philipstarkey commented 9 years ago

Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


After compile and restart, BLACS gets grouped together with runamanger in the taskbar in Windows 7.

philipstarkey commented 7 years ago

Original comment by Shaun Johnstone (Bitbucket: shjohnst, GitHub: shjohnst).


On our new Windows 10 machine it gets grouped with lyse (which was previously not pinned to the taskbar)

philipstarkey commented 7 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Ah, that's silly. I've noticed this on windows 7 too, I think.

The restart behaviour should be changed to be a bit "fresher" than the current method, which replaces the currently running process. It should instead launch a new one. I'll probably make zprocess grow a "restart current process" function to that runs the command that started the current process, after a delay, as a new process, that way the restart behaviour should be the same as the normal-start behaviour.

philipstarkey commented 7 years ago

Original comment by Philip Starkey (Bitbucket: pstarkey, GitHub: philipstarkey).


Isn't that what it already tries to do? It relaunches with subprocess.POpen [code]

philipstarkey commented 7 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Oh, so it does! I think that changed at some point, I think it used to be os.execv or something, but maybe I'm mistaken.

I can test on Windows at NIST, and try a few things, but if anyone else wants to have a go at this, I'd suspect a few things: One, that the parent process doesn't die before its child process starts - this means there are two BLACS processes running at the same time, although, to be sure, the second one is delayed and so should not be calling the AppID functions until the first one is dead.

You might have some luck settings the DETACHED_PROCESS flag, which I've used for things like launching a zlock server automatically without wanting it to be a child process of the current process (example here). But this would mean that the new process would not inherit the old one's terminal, which would be unfortunate if you are running from a terminal for debugging.