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 7804357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:53:15+00:00 2026-06-02T01:53:15+00:00

I saw asm(pause) in other people’s code and I wonder what it does. The

  • 0

I saw asm(“pause”) in other people’s code and I wonder what it does. The code is compiled by g++ on Linux.

This line is in a loop that’s in another thread, which constantly polls if an update happens. I suspect it makes the program pauses a bit before polling again, but I wonder (1) Is my guess correct (2) why is it necessary to pause? The machine we run the code on has many processors and I the thread would totally just keep polling it.

  • 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-06-02T01:53:17+00:00Added an answer on June 2, 2026 at 1:53 am

    Basically that is called a spin loop, or busy wait. It would consume as much CPU resources as it can. This wastes CPU processing power and increases power consumption.

    By putting pause instruction, you’re hinting the processor that “this is a spin loop.” This forces the processor not to be too smart to make unnecessary predictions (optimizations). Also, it frees up CPU time to be used for other things in some cases (e.g. Hyperthreading).

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

Sidebar

Related Questions

I saw this C# using statement in a code example: using StringFormat=System.Drawing.StringFormat; What's that
I saw this interview question recently for a firm that said: Group of people,
I saw a blog post the other day that had a screen shot of
I saw a java function that looked something like this- public static<T> foo() {...}
Saw this line in a class method and my first reaction was to ridicule
Saw this signature today: public interface ISomeInterface<in T> What impact does the in parameter
I saw in Crockford's Book Javascript: The Good Parts that he does typeof comparison
I saw this code in another SO post: jQuery UI Autocomplete with ASP MVC
I saw this code in C and run it: int i,j; scanf(%d %d+scanf(%d %d,&i,&j));
Saw this piece of code in a Ruby on Rails book. This first one

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.