Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 726365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:26:36+00:00 2026-05-14T06:26:36+00:00

I somehow have the feeling that modern systems, including runtime libraries, this exception handler

  • 0

I somehow have the feeling that modern systems, including runtime libraries, this exception handler and that built-in debugger build up more and more layers between my (C++) programs and the CPU/rest of the hardware.

I’m thinking of something like this:

1 + 2 >> OS top layer >> Runtime library/helper/error handler >> a hell lot of DLL modules >> OS kernel layer >> Do you really want to run 1 + 2?-Windows popup (don’t take this serious) >> OS kernel layer >> Hardware abstraction >> Hardware >> Go through at least 100 miles of circuits >> Eventually arrive at the CPU >> ADD 1, 2 >> Go all the way back to my program

Nearly all technical things are simply wrong and in some random order, but you get my point right?

  • How much longer/shorter is this chain when I run a C++ program that calculates 1 + 2 at runtime on Windows?

  • How about when I do this in an interpreter? (Python|Ruby|PHP)

  • Is this chain really as dramatic in reality? Does Windows really try “not to stand in the way”? e.g.: Direct connection my binary <> hardware?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:26:37+00:00Added an answer on May 14, 2026 at 6:26 am

    “1 + 2” in C++ gets directly translated in an add assembly instruction that is executed directly on the CPU. All the “layers” you refer to really only come into play when you start calling library functions. For example a simple printf("Hello World\n"); would go through a number of layers (using Windows as an example, different OSes would be different):

    1. CRT – the C runtime implements things like %d replacements and creates a single string, then it calls WriteFile in kernel32
    2. kernel32.dll implements WriteFile, notices that the handle is a console and directs the call to the console system
    3. the string is sent to the conhost.exe process (on Windows 7, csrss.exe on earlier versions) which actually hosts the console window
    4. conhost.exe adds the string to an internal buffer that represents the contents of the console window and invalidates the console window
    5. The Window Manager notices that the console window is now invalid and sends it a WM_PAINT message
    6. In response to the WM_PAINT, the console window (inside conhost.exe still) makes a series of DrawString calls inside GDI32.dll (or maybe GDI+?)
    7. The DrawString method loops through each character in the string and:
      1. Looks up the glyph definition in the font file to get the outline of the glyph
      2. Checks it’s cache for a rendered version of that glyph at the current font size
      3. If the glyph isn’t in the cache, it rasterizes the outline at the current font size and caches the result for later
      4. Copies the pixels from the rasterized glyph to the graphics buffer you specified, pixel-by-pixel
    8. Once all the DrawString calls are complete, the final image for the window is sent to the DWM where it’s loaded into the graphics memory of your graphics card, and replaces the old window
    9. When the next frame is drawn, the graphics card now uses the new image to render the console window and your new string is there

    Now there’s a lot of layers that I’ve simplified (e.g. the way the graphics card renders stuff is a whole ‘nother layer of abstractions). I may have made some errors (I don’t know the internals of how Windows is implemented, obviously) but it should give you an idea hopefully.

    The important point, though, is that each step along the way adds some kind of value to the system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 380k
  • Answers 380k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I should imagine that a pointer you are using is… May 14, 2026 at 10:00 pm
  • Editorial Team
    Editorial Team added an answer The server-side validation will always occur, so you don't have… May 14, 2026 at 10:00 pm
  • Editorial Team
    Editorial Team added an answer Issue resolved...... I had 2 areas, and it matched the… May 14, 2026 at 10:00 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.