Jump to content
Sign in to follow this  

August 2015 Update - A week with Michael

6 posts in this topic Last Reply

Recommended Posts

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!  

Register a New Account

Sign In  

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By Larma
      My game crashes about 5 minutes into loading a map even on vanilla (-noWorkshop -noMods). I'm guessing it has something to do with my RAM based on similar posts, but  shouldn't 8gb of ram enough even for the un-modded game?
      The full log
      E: My specs:
      Operating System
          Windows 10 Home 64-bit
          AMD FX-8320   
          Vishera 32nm Technology
          8,00Gt Dual-Channel DDR3 @ 722MHz (9-9-9-24)
          ASUSTeK COMPUTER INC. M5A97 R2.0 (Socket 942)   
          S22B300 (1920x1080@60Hz)
          V226HQL (1920x1080@60Hz)
          4095MB NVIDIA GeForce GTX 760 (Gigabyte)   
          931GB Seagate ST1000DM003-1CH162 (SATA)  
          100GB Microsoft Storage Space Device (SATA)   
          930GB Microsoft Storage Space Device (SATA)   
      Optical Drives
          ASUS DRW-24F1ST a
          Realtek High Definition Audio
    • By AmiPolizeiFunk
      Two different authors have had their assets break in the last 24h after trying to update them. I wonder if CO changed something? 
      broken satellite dish prop: https://steamcommunity.com/sharedfiles/filedetails/?id=904028991
      broken ferry: http://steamcommunity.com/sharedfiles/filedetails/?id=1111278454
      In the main menu when I went to "ASSETS", modtools spat out an Image Error. And C:S showed wrong thumbnails for those assets.
      anybody know what may be going on?
    • By AmiPolizeiFunk
      I frequently run walking or biking paths next to roads, painstakingly aligned for aesthetics w/ MoveIt. When I want to change the road type, or even simply change the network skin, it destroys all of my nearby paths. Is there a way to update a road type non-destructively? This has been a nuisance for a year now and I guess I finally feel like posting about it.
      I've had to either a. rebuild everything that it destroys, or b. drag stuff away from the update in advance, and then drag the stuff back. Since my stuff is usually heavily layered, both of these solutions suck. Do you guys have any ideas?
    • By Don_Pato

      2012, Jarunja City - The government became Tennis, a serious sport. In effect was built the Jarunja Open Stadium. This event is the most important in the region.

    • By AmiPolizeiFunk
      As expected, my save failed to load. What's the protocol here? Should I disable all mods and try to add them back one-by-one?
      Let's help each other out by listing out mods that have been broken and should definitely be disabled. Who will go first?
  • Recently Browsing   0 members

    No registered users viewing this page.


Help Keep Simtropolis Online, Open & Free!


Get the best of the best from the STEX!

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

Make a Donation, Get a Gift!

We need to continue to raise enough money each month to pay for expenses which includes hardware, bandwidth, software licenses, support licenses and other necessary 3rd party costs.

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