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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:18:27+00:00 2026-06-14T09:18:27+00:00

Novice Programmer here – I have an application with two threads that I start,

  • 0

Novice Programmer here – I have an application with two threads that I start, they then run two different loops. Someplace along the lines of the loops both threads access the same class. In one loop I am instantiating an object in the constructor of that class, then using that object in a method – Then when the second loop tries to instantiate the same class it basically just sits on the constructor and doesn’t execute that line of code.

Am I explaining my problem clear enough? Does anyone have any idea why this is happening, or more importantly why?

I have been looking into SyncLock but I don’t how I would implement this here. Should I just SyncLock my whole class, so only one loop can access it at a time? I feel like this kind of defeats the purpose of Threading then. Any help anyone can offer is appreciated.

  • 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-14T09:18:29+00:00Added an answer on June 14, 2026 at 9:18 am

    Private Shared Variables ended up being the answer.

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

Sidebar

Related Questions

I am novice PHP programmer and I have created a function that changes an
New ROR programmer here. I'm trying to build a web application that allows a
Novice programmer here. I'm writing a program that analyzes the relative spatial locations of
I'll admit I'm a novice programmer and really the only experience I have is
Novice programmer here. trying to learn static methods and recursion. No idea why I
A noob question here, by a novice programmer. I am trying to do a
novice Perl programmer here!. I'm using the system() function to get the return code
I am a novice programmer in python. I'm currently constructing a class that parses
I am a novice programmer who mainly uses Java. Recently I have become interested
I'm new here, also a novice programmer, and not really familiar with PHP. I

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.