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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:25:49+00:00 2026-05-11T13:25:49+00:00

I make the following reasoning, please tell me what’s wrong (or right) about it:

  • 0

I make the following reasoning, please tell me what’s wrong (or right) about it:

‘If inlining a function duplicates the code in the place the function is called, then the static and local variables are duplicated for each function calling it and if there is only one thread running the function that calls the inlined one at the same time, then the code is thread-safe’.

‘And, if it doesn’t help with static and global variables, does it with code that is creating temporary variables?’

Thanks

  • 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. 2026-05-11T13:25:50+00:00Added an answer on May 11, 2026 at 1:25 pm

    When you declare a function as inline, it is merely a hint to the compiler. Static variables have a clear definition in the language. If the compiler does inline the function, it is still obligated to keep the static variables shared between all instances of the function. Therefore, they will remain global and have to be protected in a MT environment.

    As to the local variables, unless they are used outside of the function, they are thread safe regardless of the function being inlined or not.

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

Sidebar

Related Questions

I can't make the following work. I know it's because of the PHP function
How do you make the following code work? example = %%(test)% % {'test':'name',} print
I need to make to following snippet of code work in the context of
How do I make the following function inside a class and then access this
How would I make the following code work? <c:if test=${null != searchResults} > <c:forEach
I make the following method call in my code: NSURL *modelURL = [[NSBundle mainBundle]
When I make the following jQuery call $.post('/publish/comments', parms, function(data, textStatus){ console.log('textStatus: ' .
I want to make the following code: <h2>TEXTz</h2> <p>ARTICLE</p> <h2>TEXTx</h2> <p>ARTICLE</p> Look like this:
I am trying to make following snip of code lockless using interlocked operations, Any
I make the following JQuery(v1.5.1) Ajax call: function testAjaxCall() { $.ajax( { url: /Search.ashx?,

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.