Sorry if this has been asked before, I can't find the answer on the wiki or through searching the forums.

I'm using the software renderer at the moment (very cool btw!) and was wondering if it's possible to use more than one thread/core to generate the output image if available. At the moment I'm seeing 100% usage of a single CPU on multicore machines.

Thanks for any help (and for the wonderful jpct)

Kev

PS. Just experiementing at the moment, will write up on cokeandcode soon

Well, i attempted to add support for multiple cores/cpus a few times in the past. Always with a different approach (split per polygon, split per scan line, split the screen into different sections)...and none was really satisfying. With version 1.19, i tried another, much simpler, approach to add at least some support for it to the software renderer. You can try it by using this version: http://www.jpct.net/download/beta/jpctapi_119pre1.zipIf you set Config.useMultipleTreads to true, the software renderer will use two cores for a tiny little bit of the rendering. The benefits aren't very impressive right now (if any...)...it helps most when using oversampling. It's still experimental, so it may improve in the future.

On my box (2 processors, 1 core each) it seems to utilise both.On another box (1 process, 2 cores) it seems to only use one threadOn a third box (4 process, 2 cores each) it seems to use each processor, but only at 40%ish.

I've had people check what Runtime.getRuntime().availableProcessors() returns, each time it returns the number of hardware threads available (equal to the cores). So above 2, 2 and 8.

It's actually pretty dumb...it spawns as many worker threads as you tell it in Config.maxNumberOfCores. You may as well configure it for 32 threads (as pointless as that may be on today's hardware) and it will use 32 threads for rendering. You can easily visualize this by using Config.mtDebug=true;In addition to the rendering, it uses up to two threads for clearing the frame- and zbuffers. Anything more than that doesn't make any sense, but it will reduce cpu usage on manycores as well as displaying the rendered image in the browser does, because not all cores will be fully utilized in that stage.How the threads are scheduled to the cores/virtual cores is up the OS...and you'll get some overhead from the thread management itself. On my quad core, your applet uses around 55% of all four cpus. That a little less than my test cases do, but those don't include any game play and no browser overhead.