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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:30:17+00:00 2026-06-02T19:30:17+00:00

I tried to explain it all in the title: I have a multithreaded C

  • 0

I tried to explain it all in the title: I have a multithreaded C program which will have multiple windows calling one Window Procedure.

There is some processing done in the window procedure. Do I need to protect it, or will each call to the window procedure be separated in memory?

My instinct is that I don’t need a mutex, because they’re all local variables, is this wrong?

LRESULT APIENTRY EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 
{   
    if (uMsg == WM_GETDLGCODE) 
        return DLGC_WANTALLKEYS;
    else if(uMsg == WM_CHAR)
    {
        if( (int) wParam == 13)
        {
            char* strCurrentCommand;

            unsigned long ulThisConversation = GetConversation(0, 0, hwnd, 0, 0);
            ...

I’m concerned with the local variables strCurrentCommand and ulThisConversation.

  • 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-02T19:30:19+00:00Added an answer on June 2, 2026 at 7:30 pm

    Local variables and parameters to functions go on the stack. Each thread gets its own stack, and each invocation of a function gets a space on the stack of the thread it’s running in for its parameters and local variables. So you’re fine.

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

Sidebar

Related Questions

Rails 3.2.2 Ruby 1.9.3 all browsers I have tried (Aurora, IE, Chrome) Windows 7
Recently I tried to explain some poorly designed code to my project manager. All
I tried to analyse the FieldCacheImpl in Solr 3.5.0, can any one explain me
I've tried to load Disqus with ajax in my page, i'll explain. I have
The title pretty much explains it all, I have a Member object that references
I have 2 methods I tried to iterate through all my textboxes in an
I tried modules 'less' and 'less-middleware'. I tried all the different code-snipplets I have
I tried to ask this question before but I guess I didnt explain myself
I tried this example in Perl. Can someone explain why is it true? if
Ok, I understand the Title didn't make any sense so here I've tried to

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.