User forums > General (but related to Code::Blocks)

Code::Blocks Performance !!

<< < (2/2)

boaz:
I was looking at compilergcc.cpp to see why the stop does not work. It does a wxKill which does an EnumWindows, needless to say that that will never work on redirected consol application like GCC. Well I was thinking that, the all thing could be done with popen (_popen in msvc) it works very fast, and reads could be done full lines at a time. Also the "terminate" is easy and I even think you can send ctrl+c through it. This is also very Unix portable. I'll make some test.

That or Intel's VGA sucks big time

thomas:
Don't waste your time, we have tried popen many months ago. It is fine for Linux, but it won't do for Windows.

Stop does work. Within the operating system's capabilities.
Your objection regarding wxKill is correct, but that is a known Windows problem. Windows does not support any such thing as SIGTERM (which would be the right thing to use in this place). The only alternative would be to use SIGKILL, that would certainly end the process, but this is not an option, for obvious reasons.
Under Linux, the stop button works as you expect it, because SIGTERM is used.

boaz:

--- Quote from: thomas on March 01, 2006, 09:27:11 am ---Don't waste your time, we have tried popen many months ago. It is fine for Linux, but it won't do for Windows.
--- End quote ---

It works fine in msvc++ implementation from msvcrt.dll. The GCC implementation I never tried.


--- Quote ---Stop does work. Within the operating system's capabilities.
Your objection regarding wxKill is correct, but that is a known Windows problem. Windows does not support any such thing as SIGTERM (which would be the right thing to use in this place). The only alternative would be to use SIGKILL, that would certainly end the process, but this is not an option, for obvious reasons.
Under Linux, the stop button works as you expect it, because SIGTERM is used.

--- End quote ---

I don't see how it can work. The code Does an EnumWindows() looking for which Window has the passed PID. Now GCC or mingw-make has no Window, so it is not enumerated. and is never sent any signals.
If you have built-in project than all pending files are flushed and the build stops after the current file, fine. But on an external Make. Nothing is actually done.

boaz:

--- Quote ---Windows does not support any such thing as SIGTERM
--- End quote ---

what about GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT ,consolProcessID);

more signals are:

#define CTRL_C_EVENT               0
#define CTRL_BREAK_EVENT        1
#define CTRL_CLOSE_EVENT        2
// 3 is reserved!
// 4 is reserved!
#define CTRL_LOGOFF_EVENT      5
#define CTRL_SHUTDOWN_EVENT 6

thomas:
I have never used that function, but MSDN talks about "a console process group that shares the console associated with the calling process".
This means (if I read it correctly) that the IDE and the build tools would have to share one console for this to work. That is of course not acceptable since an abnormal termination of a compiler process might terminate the IDE too, in that case.

Nevertheless, I may of course be wrong, feel free to make a patch for wxExecute and submit it to wxWidgets. It is a very platform-dependent thing, so any modifications should go into wxWidgets.

Navigation

[0] Message Index

[*] Previous page

Go to full version