Jump to content
Fantozzi

-CPUcount:1 Myth or truth?

22 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

What does this command exactly do? I always felt a little bit stupid to command dogs to bark just because I know they can't meow - so only because you know dogs can't  meow you command them to bark.

To command a programm that can only make use of exactly one core it should use exactly only one core - where is the sense doing so?

I'm asking because I play SC4 on a quad core. And in in the last five years somtimes I used this command, but sometimes I didn't. And I wasn't able to find any difference in performance and stability.

But maybe I'm too dumb to see the difference between a programm that uses one single core and a program that uses one single core and on top you tell it to use only one single core. Maybe it's because algorithms may not always do as told - so for the rare cases algorithms don't obey it's better to tell them they must obey?

Or is there any documentation I can read about what this command does on SC4 exactly?

 

It's beyond my imagination to what it exactly limits a dog to tell him not to meaow? I mean is there a big risk the dog will meaow if I forget to tell him not to meaow? Are there any reports SC4 was miaowing - sorry, I mean was using different cores and you had to stop this?

Is it myth or truth?

  • Like 1

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I'm sure that @rsc204 will be able to give a much more coherent explanation for this, but what I know is that the command precisely points the application to run exclusively and specifically on the first core of your CPU (i.e. CPU0), and that that is done to prevent old executables to 'choke' by using multithreading without having been developed to do so.

And while I've seen some anecdotal data on this effectively improving the game stability, multithreading isn't the only known cause, and there is no systematic, scientific proof of this being more effective than a placebo (oh deities, I sounded like the worst smug :noway:)

  • Like 3

matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

"Let us be scientists and as such, remember always that the purpose of politics
is not freedom, nor authority, nor is any principle of abstract character,
but it is to meet the social needs of man and the development of the society"

— Valentín Letelier, 1895

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Oh, this is a fact. I can testimony it from my own game. When the cities began to grow, I did suffered frequent crashes to the desktop. CTD. Especially when I zoomed in or out with mouse wheel. A lot of calculation goes with a sudden change of zoom and this cause stress to the CPU. To alleviate this the computer wants switch CPUs, which old program SC4 does not like. So confusion causes it to crash.

Yes, soon there will be much better explanation what and why happens, but this is not myth. CPUcount:1 works. Together with transit puzzle piece dll fix, my SC4 is almost crash free. :)

  • Like 2
  • Yes 1

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    48 minutes ago, Bombardiere said:

    A lot of calculation goes with a sudden change of zoom

    I'm really no computer expert - I just try to imagine what might happen and so it might be a silly believe why I doubt that. When zooming SC4 has to update a vast amount of pictures- there isn't really much to calculate for the cpu, I would suppose, but it would be stress for the memory and most probably there will be created a swap file and I suspect this causing CTD because the swap file will make updating the graphics very slow. The same reason why somtimes when zooming the buildings are blurred and it takes a long time until they become clear again. My suspicion is - this is because it's a large amount of data it is processed on HD instead of physical memory and therefore it takes so long. So it's only believe CPU count does something on this - meanwhile cpu isn't the bottleneck - it's memory. I agree, it's only theory by myself.

    Still, to have peace of mind, I would need more proof of the cpu being stressed by zooming.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Basically the problem here is that SC4 was not coded to take advantage of multi-threaded use. Although a modern OS (Vista onwards) will see the tasks created and try to offload them onto separate cores/threads where possible. But to do this without error, the application needs to keep in "rhythm" with these processes. Since it was not coded to work this way, when the timing of such multi-threaded parts get out of synch, such as if one core is busy and can't process the thread right away, that's when you see the CTD. Because the application doesn't recognise the "message" sent from the CPU telling it to wait for that part to be processed. This doesn't happen often, since the bulk of SC4s code remains in a single threaded environment where it's code simply can not be offloaded to separate cores/threads, regardless of the O/S.

    I've heard cases of those who say they never get these CTDs, despite not using the single-core switch, but my experience and that of many others, is the exact opposite. The second I run without this command, I get constant crashes which are instantly solved by adding it back.

    Try this test, remove the -CPUCount:1 from the target, open a city and zoom in and out as fast as you can, just go nuts with the scroll wheel. I'd be very surprised if you didn't get a crash, especially if it's a well developed city. Add the command back, and even stressing the game in this way, it remains totally stable.

    Bear in mind, if you are using an older version of Windows (XP or earlier), whilst they support multi-core, they aren't optimised for it. So you probably don't need to add the command, because the O/S is simply not offloading parts of the runtime onto other cores to begin with.

    It doesn't matter which Core SC4 uses, so long as it only uses one of them constantly, the application remains stable. Some technical stuff here may help you:

    2 minutes ago, Fantozzi said:

    Still, to have peace of mind, I would need more proof of the cpu being stressed by zooming.

    As mentioned in the linked post, it's one of those parts where the O/S tries to optimise runtime by offloading a separate process to another core. Of course it's memory intensive, but it is the CPU that is behind the bug.

    • Like 7

    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Topic: Need help with sc4pac
     

    When I first started playing SC4 I wasn't aware of the -CPUCount:1 thinger. Sometimes I could play a couple hours with no problem. Other times it'd crash in 30 minutes. Sometimes only 5 minutes before I was suddenly staring at my desktop. I Googled SC4 crashing and found the recommendation for this switch. I added it to my startup and I've not crashed since. While that's merely empirical evidence rather than the techy insider details, it convinced me to always use it. (And recommend it to anyone else.)

    • Like 3

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    @rsc204 - explicit thanks for the link. Convinced. No myth. Truth.

    • Like 4

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    11 hours ago, rsc204 said:

    I've heard cases of those who say they never get these CTDs, despite not using the single-core switch, but my experience and that of many others, is the exact opposite. The second I run without this command, I get constant crashes which are instantly solved by adding it back.

    I think "play styles" affect to risk get CTD. For me it happen mostly when I zoomed or dragged cursor around the map. However, my game had crashes when I did absolutely nothing so it not a single definitive situation, which causes computer to try access more CPUs. And I think not all access attempts cause crashes.

    Edit: @rsc204 I should have read your post more carefully. :blush: There was info that zoom is one of parts where systems tries to access multiple CPUs. For me this was the most obvious one.

    So this improves stability, but as far as I can tell, it does not improve performance. In fact it may lower the performance as the computer has fewer resources to access.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Indeed, offloading some tasks to other cores will provide a slight performance boost, but the cost is way too high for the marginal performance it offers. Without proper multi-threaded support, you really aren't missing out on much.

    • Like 2

    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Yes, with my older computer I felt that SC4 was slightly more sluggish after CPUCount:1 But the gameplay without constant crashes was so great reward that I did not mind. :)

     

    P.S This is not a fact, this is just feeling. :)

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    So to correct the initial picture to - hopefully - make it sound right:

    CPUCount:1 is more a sort of collar I put around my dogs necks telling others: please don't command my dog to meaow. Because if you command he will try for real and terrible fail as he gets out of rythm what might lead to a sudden heart attack.

    Something like this?

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Sounds about right. I think I got most crashes when building roads. Playing SC4 without restricting it to one core is definitely not enjoyable on my computer.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    In my very own case, restricting the CPU count to 1 made wonders on my game. My rig is rather old already (like 5-6 years old), so the difference in gameplay is barely noticeable. Still, stability improved a lot since I added the -CPUCount:1 command, especially when zooming. Before that, accidentally hitting the mouse wheel granted me a CTD. Now most CTDs I have happen right after saving the game. 

    Truth? Myth? Who cares if the solution works?

    • Yes 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    To be fair without that code, I keep on having CTDs but after using it, the chances of having CTDs lessened drastically to the point that it doesn't even happen anymore. So yeah, experience wise, it works but in terms of technicalities, I have no idea.


    msqlrW8.jpg

    TEiKO. IT'S MORE FUN HERE!

    What good would it bring if a man gains the whole world but loses his soul the one he loves?

    You can also find me in skyscrapercity, sc4devotions, yaoi otaku forum, anime-manga forum, the blue knight forum, mangafox, archives of our own, fanfiction, tumblr, blogspot, instagram, facebook and twitter.

    MNL-CGY-DVO-CEB-ILO-SIN-TPE-PPS

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Using CPU count:1 my game has never crashed. . .except for a few self inflicted ones with TE lots.

    • Confused 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Topic: Need help with sc4pac
     
    7 hours ago, Eagle74 said:

    . . .except for a few self inflicted ones with TE lots.

    And you do know there's a fix for that too? (here)

    • Like 1
    • Yes 1
    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I had heard that there was a fix.  Thanks for the link,  I'll check it out. 

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I'm one of those who have never used it and only time I suffer from crashes is zooming out too fast when there is over 35000 lots in a large city tile. I also only play with a cpu that is overclocked to 4.1 ghz and that is primarily why I dont like the 1 cpu idea - I dont want just one core runnng hot while the others idle by, I would rather the load get spread and have manageable temps.


    Known as Kitsune on sc4e. NAM Team Member.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    3 hours ago, redfox85 said:

    I dont want just one core runnng hot while the others idle by, I would rather the load get spread and have manageable temps

    But it doesn't work that way in practise, because the game can not offload much onto other cores anyhow. To really utilise a multi-core system the code must be designed to split the workload, but this simply isn't the case with SC4. As mentioned previously, some parts that are offloaded to a separate process can benefit from being run on a separate core. Realistically if that improvement was 5%-10% in real terms, I'd be genuinely surprised. So most of the work will still be done by a single-core that will be running hot, no matter what you do.

    Not to mention, disabling multi-core for SC4, does not prevent those other cores being used by the background OS and other running apps. If you've a suitable cooling setup to manage your overclocking, this should all be a non-issue. Frankly I've never personally been a fan of overclocking, in essence you are trading long-term reliability for a slightly quicker speed.


    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    15 minutes ago, rsc204 said:

    But it doesn't work that way in practise, because the game can not offload much onto other cores anyhow. To really utilise a multi-core system the code must be designed to split the workload, but this simply isn't the case with SC4. As mentioned previously, some parts that are offloaded to a separate process can benefit from being run on a separate core. Realistically if that improvement was 5%-10% in real terms, I'd be genuinely surprised. So most of the work will still be done by a single-core that will be running hot, no matter what you do.

    Not to mention, disabling multi-core for SC4, does not prevent those other cores being used by the background OS and other running apps. If you've a suitable cooling setup to manage your overclocking, this should all be a non-issue. Frankly I've never personally been a fan of overclocking, in essence you are trading long-term reliability for a slightly quicker speed.

     

    Overclocking with proper cooling does not limit the life span - I've had OC'ed cpus last 5 years and only stop using them as its time for an upgrade. Each cpu / thread is used at roughly 15%... way better in my book then having one at a 100%. 


    Known as Kitsune on sc4e. NAM Team Member.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    10 minutes ago, redfox85 said:

    Overclocking with proper cooling does not limit the life span - I've had OC'ed cpus last 5 years and only stop using them as its time for an upgrade.

    Yes it does, perhaps that doesn't effect your expected operating life for the product, but you are causing more wear and tear. Simply put, two identical systems, one overclocked, one not, under normal circumstances the non-overclocked one would last longer, because it is stressed less throughout it's life.

    Quote

    Each cpu / thread is used at roughly 15%... way better in my book then having one at a 100%. 

    Really? You don't understand how multi-core/parallel processing works then. Because it absolutely does not mean every task on your computer is split evenly between the cores/threads available. In an ideal world, it would work that way, but we're very far from that in practise. If each core only worked at 15% max, that would mean you are wasting 85% of the potential power of your CPU overall. Yet despite this, you want to overclock it, that's a little illogical if you think about it. Not to mention a thread is not the same as a logical core, assuming you have a HyperThreaded processor, one core can handle two threads at a time, ignore what Windows tells you, one core is doing the work of both.

    I've a 4/Core 8 Thread i7 4770 in my machine. I've seen it chugging along with all cores maxed out, I'm quite happy when it does. Because it shows me I wasn't completely wasting my money when I bought my expensive CPU, I do actually use it sometimes to it's full potential. But that really only happens when I'm rendering in 3DS Max and Encoding in Premiere Pro. Most of the time my CPU idles along saving energy, because I simply don't need it running at full chat. Very little of what I do with my PC comes close to using the full power of my chip. But the load balancing between cores is almost never even, usually one or two cores are doing the higher percentage of the work. Which is fine, Intel designed the chip to work better this way, TurboBoost allows optimisation when only one core is fully active, because there is spare thermal capacity to overclock it safely.


    Head over to my Lot and Mod Shack to keep abreast of my latest developments.

    Do you like custom textures, but don't like all the work involved creating them?, take a look at the Texture Automation options here. Change the look and feel of your transit networks, with the minimum of effort, for example customised versions of my Sidewalk NAM (SWN) and Terrain Grass NAM (TGN) mods, and much more besides.

    New to the NAM? Check out my tutorials on YouTube. Latest upload: How to: RHW - MHO Roundabout Interchanges. (Nov 25).

    p.s. - I'm MGB over on SC4D and a member of the NAM team.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 8/18/2017 at 2:23 PM, rsc204 said:

    if you are using an older version of Windows (XP or earlier), whilst they support multi-core, they aren't optimised for it. So you probably don't need to add the command

    My XP (SP3) definitely needs the switch.

    On 8/18/2017 at 2:06 PM, Bombardiere said:

    soon there will be much better explanation what and why happens, but this is not myth. CPUcount:1 works.

    Based on my own observations, I think that when some objects are moving and you zoom to redraw everything, the system can assign motion control to one CPU and modeling to another, and then you can get a concurrent modification exception (two threads trying to update the same data at the same time). That's because SC4 is not thread-safe.

    As was suggested above, the best way for your multi-core CPU to empower SC4 is to reserve a core for SC4 only and then make sure it runs there. Then at least SC4 won't need to share its one core with any other processes.


    -- Jeff Fisher ><> Vancouver WA
    "I may be pissing into the wind, but if I keep my enemies behind me and aim carefully, I can still rain on their parade."

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections