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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:31:10+00:00 2026-05-28T03:31:10+00:00

Suppose i have following code Rectangle rect = new Rectangle(); lock(rect) { —- —

  • 0

Suppose i have following code

Rectangle rect = new Rectangle();
lock(rect)
{
  ----
  ---
  ---
}

Can the rect object, or its properties be modified in some other thread, while one thread has acquired the lock, and executing in critical section.

  • 1 1 Answer
  • 2 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-28T03:31:11+00:00Added an answer on May 28, 2026 at 3:31 am

    Can the rect object, or its properties be modified in some other
    thread, while one thread has acquired the lock, and executing in
    critical section.

    If all code that accesses that object first attempts to acquire the same lock, then No.

    Without the locking code wrapper, then yes another thread can (and at some point will) write to the rect with inconsistent results.

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

Sidebar

Related Questions

Suppose I have the following code: foreach(string str in someObj.GetMyStrings()) { // do some
Suppose I have the following: using(var ctx = DataContextFactory.Create(0)) { ... Some code ...
Suppose we have following code defined in tester.py class Tester( object ): def method(
let's suppose to have following code: <body style=overflow: hidden> <div class=wall> <button>New</button> <div class=prova>
Suppose I have the following code: void* my_alloc (size_t size) { return new char
Suppose I have the following code: <c:when test=${isFoo}> Where can isFoo be defined except:
Suppose I have the following code DataSource source = (DataSource) (new InitialContext()).lookup(jdbc/myName); Connection connnection
suppose that,we have following code auto_ptr<T> source() { return auto_ptr<T>( new T(1) ); }
Suppose I have following code package memoryleak; public class MemoryLeak { public static int
Suppose I have the following code: class some_class{}; some_class some_function() { return some_class(); }

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.