• Moose
  • Announcements

    • Dirktator

      Help us with our donation goal for a new Chat upgrade!   04/17/2017

      Your donations not only help keep the site up and running, but also allows us to expand some functionality and upgrade other features of the site periodically to stay current! We're looking for some community support to help us get a new Chat system (as you know our old Chat is no longer supported by IP.Board). A new system promises to give us many more options and all for fairly little cost, relatively speaking. Please help us reach our April goal so we can keep bringing you site improvements as well!  Donate and Get a Gift or Donate Any Amount Thanks so much! - Dirktator & The Admins
Sign in to follow this  
Followers 0

August 2015 Update - A week with Michael

6 posts in this topic

Well, a happy return to the fatherland and a vacation in sunny Spain.  Good for you!

Your transition diagrams remind me of some stuff related to a COBOL compiler.  Funny how these old concepts persist, but oldies are often goodies.  The idea of a pseudo-browser running multitasking is just fascinating.  What a nice set of ideas follow.

Since mods will be procedural, I hope you are setting up some kind of test bed for them when the time comes.  With multitasking, don't bet that all programmers are as capable as your build team.  One missed semaphore and it's deadly-embraceville.

Share this post

Link to post
Share on other sites

Sounds like the face to face was very productive.  :thumb:  The update wasn't fully above my head in the more technical parts, but it was like I was just barely able to touch with my tip toes jumping to breath.  One thing that I understand is that there will be city chunks (dare I say neighborhoods?).  These chunks make it so that you don't have to simulate the whole city at once, or that the city chunks are divided by cores, or something like that.  My question is, what will be the determinate of size for these chunks?  Will it be the number of citizens at max density, or what?  Will the other chunks of the city be visible, or will there be a cut off like in SC4?  Will you have to load to go to another chunk, or do you simply scroll and at most experience a brief moment of lag while things transition?  Or are these things not figured out?

Share this post

Link to post
Share on other sites

Since we are really dealing with a single process with multitasking, I think the chunkiness will be transparent to the player and is simply an administrative task for the program.  The number of chunks could simply be decided on divisions of the grid, but the number of objects being a better measure, and therefore this may be dynamic.

We are dealing with not only multitasking here but also another invisible feature, namely, virtual memory.  This could make the universe of discourse (the city) of almost infinite size depending on the size of the backing store.  Mine happens to be 20 GB but I can easily add another partition to that.  This might turn out to be a serious limitation in both Windows and OS/X.  Linux uses full partitions of any size as backing store and can have several at the same time.  I have much unused disk space.

With respect to multitasking, I have only two cores, but the number of cores in deciding what constitutes a chunk is irrelevant.  You could have fifty chunks, each set up to be scheduled by the system dispatcher (scheduler), and you'd probably never notice.  Time slices are in the order of milliseconds.  Say, for example that you have a slice of 50 ms.  In that time, allowing for overhead, you could probably schedule 195 user tasks, and more if any of them are blocked for I/O or give up the processor on loop completion.  I should think the whole business would be pretty much imperceptible unless you were running a hardware monitor.  Remember that processor functions are in terms of nanoseconds these days.  To get a picture of this, see if you can find a rating for your machine in flops (floating point operations per second).  You'll find that machines these days with the exception of ARM processors running smart phones, are probably pretty swift.

EDIT: Dug up a benchmark or two and here is the result for my beat up old box of tricks.  The results are in seconds, with comparison results in some cases.  A power PC is a RISC box similar to an ARM processor.  Lower is better.


CPU Blowfish
This Machine2200 MHz6.825
Intel(R) Celeron(R) M processor 1.50GHz(null)26.1876862
PowerPC 740/750 (280.00MHz)(null)172.816713
CPU CryptoHash
This Machine2200 MHz217.543
CPU Fibonacci
This Machine2200 MHz2.254
Intel(R) Celeron(R) M processor 1.50GHz(null)8.1375674
PowerPC 740/750 (280.00MHz)(null)58.07682
CPU N-Queens
This Machine2200 MHz7.923
This Machine2200 MHz4.027
FPU Raytracing
This Machine2200 MHz7.679
Intel(R) Celeron(R) M processor 1.50GHz(null)40.8816714
PowerPC 740/750 (280.00MHz)(null)





The last two are floating point performance.  You'd have to dig out the programs to see what each does, but they are standard.  2200 MHz = 2.2 GHz.  Fun, huh?  Remember that a Power PC has no FPU, and no multiply/divide hardware.

Sorry about the formatting, but that's what I got.

  Edited by A Nonny Moose

Share this post

Link to post
Share on other sites

It could be that I'm really tired (which is why I'm here instead of doing my work), but most of the latter portion of what you said didn't stick.  My deficit I'm sure rather than yours.  What I got is that as far as I, the player is concerned, I won't notice the multitasking, and that because I run a windows PC, I'm not nearly as cool as you with your fancy Linux machine :) .  Sweet. 

Does this have the [droids] you are looking for?


Share this post

Link to post
Share on other sites

I was talking with my Operating System design hat on.  It doesn't matter which operating system is involved, all processor dispatchers (schedulers) pretty much operate the same way and have since sometime in the 1950s.  There is usually a single, semaphore-protected queue of processes eligible for a processor (core) and when a core becomes idle (needs a task) it closes the semaphore, enters the critical section, takes the top item off the queue (pop the queue), and releases the semaphore.  This takes only a very few machine instructions, on some machines I have used something on the order of five or six.  One of the best architectures had an instruction named Transfer after Setting Slave (TSS) which took the slave address as its operand and whomped the processor into slave mode.  The slave mode registers were set before executing this (took one more instruction).

Now, your I7 processor has four cores, I believe.  This means that you can have four simultaneous tasks running, not all of them necessarily for the application.  Most operating systems these days don't care which core does what, so you could have all of them running the application tasks, or all of them running other tasks or a mix of both.  What matters is the interrupt that next occurs on any given core.  It can be an I/O interrupt from any task that has been running, it could be an I/O block and release, or it could be a timer run out (end of time slice).  When any of these events happen, the core that answers the interrupt saves its state and goes to supervisor state to process the event including putting its previous task in whatever queue applies, then goes to the dispatcher to choose the next task of the ready queue.  The application(s) could have any number of ready tasks in the queue but the active core will take only the one at the top.  It looks complicated, but it is really simple.

Now, the machine I was talking about earlier had hardware/software married to the extent that semaphores were a kind of mixed bag.  If a processor encountered a closed semaphore (in those days it was called a gate) it would execute an instruction called Delay until Interrupt Signal (DIS) and hang just before the instruction that would test the gate.  Needless to say that there was a separate watchdog timer that caused another processor to intervene if there was a time out on a DIS.  This usually scrubbed whatever process was involved with an Operation Not Complete fault.  Usually only happened during O/S tests.

Even the marching morons of Microsoft's programming group are unlikely to get this wrong since it is a well known thing.  Don't worry about it. 

However, as more and more processes start using virtual memory, their *.swp file idea should become a partition to facilitate the system.  Up to them, because this file is managed by the O/S and not the file system at all.  Probably can't happen as long as they still have the idea of separate devices in the file system (NTFS).  IMHO this is wrong-headed, and they should know better but I suspect they are now stuck with it forever.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an Account  

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

Register a New Account

Sign In  

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • By RichardCollins
      A while back, I purchased Sim City 4 on Origin when it was on sale. I had no issues installing NAM, RHW, and even using a custom resolution. I had to reset my PC due to a virus. I reinstalled SC4, but now Origin won't update it past 1.1.610. I tried contacting support and they gave me a long list of things to do that have nothing to do with getting an update (disabling anti-virus, safe-mode, etc, etc.)
      Why did they go from giving you the fully patched version of the game to blocking you to 610? Is it something on my end or did EA actually change something? No matter if I download the game to my SSD or HDD, I get the same result. 
      A separate patch I downloaded with NAM tells me old files can't be found and won't allow me to install a new patch, so no NAM. Anyone here have the same issue? A solution besides buying another copy on GoG?
    • By wojtason
      Quick question. I shared an asset on Steam which required 3 props. Now I changed the asset and it requires just 1 new prop. How to update it so the people get this new prop automatically? 
    • By J_botz
      I'm sure there are tons of people out there using @andreharv and @BloodyPenguin"s MOM. However, I'm wondering if anyone out there has heard whether MTSE is going to be updated to support MOM. I know you would need their permission to update for them but It seems like they have abandoned.... Consider this a request, can someone PLEASE create a new version?!?! 
    • By Ln X
      It's hard work being a one-man band, I am impressed that Anselm has persevered with this project for so long. I'm glad he's going to be releasing an alpha version in three months time.
    • By anselm_eickhoff
      Long time no see, but Merry Christmas!!
      Christmas 2016 Announcement
  • Recently Browsing   0 members

    No registered users viewing this page.