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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:52:18+00:00 2026-06-05T23:52:18+00:00

I have a Javascript object created as follows: var ccStatTracker = (function (){ ccmap:{

  • 0

I have a Javascript object created as follows:

var ccStatTracker = (function (){
  ccmap:{
    "1":["1","2","3","4"],
    "2":["4","5"];       
  }

  return {
    modifyCCMap: function (){
      // Code which takes following actions: 
      // - adds/removes keys.
      // - modifies arrays stored as values against the keys in the map.  
    }  
  }
)();

I have a DHTMLXGrid component which displays grid in the form of rows and columns.
When I edit any cell in the grid, “onEditCell” event is called.
Now, I want to call ccStatTracker.modifyCCMap() from an event handler function attached to “onEditCell” event. As I go on modifying the cells, this event will be called asynchronously which will in turn call a function “modifyCCMap” which will modify private member “CCMap” of my Javascript object. So the latest state of my CCMap as seen by two calls might be different right? So what is the best way to handle this? Is there something as “Synchronized” in Javascript as in Java?

Please help me as it will determine the approach we want to take for implementing this.

  • 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-05T23:52:21+00:00Added an answer on June 5, 2026 at 11:52 pm

    JavaScript is single-threaded (web-workers aside for a moment), nothing happens asynchronously (or everything for that matter) – all code: event handlers, timeouts, callbacks, etc. – run in the same thread, one after another.

    Thus you don’t need any synchronization in JavaScript. Any given piece of code in JavaScript is guaranteed to be executed by only a single thread. How cool is that?

    See also

    • JavaScript equivalent of SwingUtilities.invokeLater()
    • "atomic" operation desturbed by asynchronous ajax callbacks
    • Are there any atomic javascript operations to deal with Ajax's asynchronous nature?
    • how is async programming (promises) implemented in javascript? isn't javascript a ui-threaded environment?
    • …
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have JavaScript components, that has following architecture: var MyComponent = function(params) { setup(params);
I have created a JavaScript extension for an array object as follows: Array.prototype.where =
I have created a javascript object var spanglist = { one: q1, two:q2, three:q3,
I have Javascript array which contains User object. I have created this array from
Lets say I have created an object and its properties in JavaScript as follows-
Lets say I have a Javascript object: var myObj = { property1 : 20,
Suppose I create a custom object/javascript class (airquotes) as follows: // Constructor function CustomObject(stringParam)
I have a JavaScript singleton object created with closure method: /** * This is
I have created a string builder JavaScript object and I'm using it with many
I create a menu with a javascript object and jquery. I have certain items

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.