121
Programming / Re: Observing if a program uses vio calls
« on: February 28, 2020, 04:30:08 pm »
If I exeute a binary directly, in most cases there comes VIO output immediately (I have no sample, but it can be different, too, that it first generates some stdout output "starting my app... please wait" and then switches to VIO, and after finishing VIO, some stdout is created (which wouldn't be a problem for me). In most cases, a first query after 400 ms without stdout output should be sufficient.
More sophisticated is the case of executing a cmd file. We discussed the case of sending the cmd file content line by line to cmd.exe stdin and the PM editor checks whether there's a VIO program in the sent text line or not. (We want to avioid this procedure.) I have got big cmd files in use which runs two minutes. It can happen that in such a long cmd file, a VIO program is placed between other stdout programs and commands.
Meanwhile, I have doubt, too, that a loop within the helper app is really useful. Instead, the PM editor could send a single query "VIO cursor position changed?" after 300-400 ms after the last received stdout. And if nothing happens at all - in the case the helper detects no VIO program and there's no stdout output anyway for seconds - the editor does not query anymore. Only if there's a new stdout output and a pause again, then it queries again. So the case of a cmd file should be covered.
In this case, I do not need a thread in the helper program which simplifies the code. No thread, no problem in suspending, resuming, memory access conflicts to consider and so on.
More sophisticated is the case of executing a cmd file. We discussed the case of sending the cmd file content line by line to cmd.exe stdin and the PM editor checks whether there's a VIO program in the sent text line or not. (We want to avioid this procedure.) I have got big cmd files in use which runs two minutes. It can happen that in such a long cmd file, a VIO program is placed between other stdout programs and commands.
Meanwhile, I have doubt, too, that a loop within the helper app is really useful. Instead, the PM editor could send a single query "VIO cursor position changed?" after 300-400 ms after the last received stdout. And if nothing happens at all - in the case the helper detects no VIO program and there's no stdout output anyway for seconds - the editor does not query anymore. Only if there's a new stdout output and a pause again, then it queries again. So the case of a cmd file should be covered.
In this case, I do not need a thread in the helper program which simplifies the code. No thread, no problem in suspending, resuming, memory access conflicts to consider and so on.