Compiling to Android/CPP

Is there a way we can alter how much of the CPU is taken up during compile time when targetting Android or CPP? I currently run a quad core system so the compiles do not take to terribly long, but during that time my system becomes unusable because it ...

Viewing 1 to 5 (5 Total)
Compiling to Android/CPP

deis

deis
Total Posts: 16
Joined: August 31, 2011

Is there a way we can alter how much of the CPU is taken up during compile time when targetting Android or CPP?

I currently run a quad core system so the compiles do not take to terribly long, but during that time my system becomes unusable because it pegs every core to 100%.

Thanks!

Tags:
Posted on August 31, 2011 at 4:28 PM

singmajesty

singmajesty
Total Posts: 2147
Joined: August 25, 2011

Hmm, that's strange.

Have you noticed whether this occurs only while compiling with the Android NDK g++ compiler, or does this occur while running the ANT packaging script? Which operating system are you using?

If you are on Windows, I just found "Process Tamer," which may help:

http://www.donationcoder.com/Software/Mouser/proctamer/...

Based on what I was reading (elsewhere on another forum), it seems to work. It watches for processes that eat a lot of your CPU, then reduces their priority so that Explorer and other foreground applications can remain responsive.

Posted on August 31, 2011 at 4:37 PM

deis

deis
Total Posts: 16
Joined: August 31, 2011

Indeed

This occurs when it is actually compiling with the Android NDK G++ compiler or when it is using the Visual Studio C++ compiler (cl.exe). When the ANT script is running, it barely uses any CPU. I am running Windows 7.

I will look into Process Tamer, but I feel like this may be an option passed in to the compiler to not use 100% resources.

Posted on August 31, 2011 at 4:43 PM

singmajesty

singmajesty
Total Posts: 2147
Joined: August 25, 2011

Seems like a .NET feature

Searching around a bit more, this seems to be a .NET feature, available to Windows applications, but it does not appear to be available through neko.io.Process, which the install tool uses to launch processes like the Visual Studio C++ command-line compiler, or g++ for Android.

I'll ask about this on the Haxe mailing list, but I don't expect an answer soon. That's strange that it maxes it out! I guess I haven't had that happen to me before. Every system is different, I suppose.

There might be another solution that could be used that would watch the command prompt, specifically, and limit the amount of CPU it can use...

Posted on August 31, 2011 at 4:55 PM

singmajesty

singmajesty
Total Posts: 2147
Joined: August 25, 2011

Hey, here's another idea

I was just thinking of this a little more, and I have a couple ideas that could help.

First, what program are you using to compile your project code? It is possible that if you are using FlashDevelop, or another editor to host the compile process, it might be able to set the process priority for you. Or, if you are compiling directly from a command prompt and are having this problem, perhaps you could open the command prompt, change the priority in Task Manager, then run the compile commands from there.

Lastly, you probably are safer after you get past the initial compile. The first time you build a project, it will compile a lot of files, but the second or third time through it only compiles a couple small files, depending on what you have changed. As a result, even if the build process is locking things up a bit, it should only, in real practice, occur a little bit and not actually make everything explode smiling

Posted on August 31, 2011 at 11:41 PM