If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.
Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.
on openStack
if $1 is empty then
put $0 && "-slave" into tSlave
open elevated process tSlave
end if
end openStack
The first issue is that the second instance starts but doesn't show its user interface.
The second issue is that the following code doesn't work in the second instance. It executes but no file is created or modified. It works in the first instance but not in the second instance.
I have resolved the second issue, and it wasn't LiveCode's fault. The second instance receives data from the first instance, specifying the name of the file to create. This data had a linefeed character at the end which, if not removed, caused the "open file" statement to fail with the result "can't open that file". I just removed the linefeed character and then it worked as expected.
just tried with same results.
I'd try to change name for one somehow - two identical instances smell like danger.
Other thing, the slave will try to open another slave (via openstack msg), and so on - maybe it's this?
Hope I could help, maybe I'll give it a try if I find a piece of spare time. What's this good for, anyways? Care to explain?
Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
The application always checks the $1 command line argument and if it is "-slave" then it doesn't launch a second instance.
I can understand why two instances of the same application smell like danger, but I've made sure the second instance knows when it was launched in slave mode. There are some well-known applications that launch multiple instances of themselves without a problem, like Google Chrome. As long as each instance knows when it's the master or a slave process and can keep proper tabs on each, it shouldn't be a problem.
I need the application to perform blocking operations requiring elevated privileges without making the user interface appear non-responsive, and in LiveCode this master-slave approach is the closest we can get to actual multithreading.
EDIT: I've just discovered that on Windows XP the user interface for the second instance does appear. I'm suspecting it might have something to do with the Desktop Window Manager which Windows XP doesn't have... but it's still a bug in my opinion.