Questions tagged [synchronization]

Synchronization refers to using controls to maintain a coherent representation, either a group of processes running the same program (process synchronization), or representations of data (data synchronization).

In computer science, synchronization refers to one of two distinct but related concepts: synchronization of processes, and synchronization of data. Process synchronization refers to the idea that multiple processes are to join up or handshake at a certain point, so as to reach an agreement or commit to a certain sequence of action. Data synchronization refers to the idea of keeping multiple copies of a dataset in coherence with one another, or to maintain data integrity. Process synchronization primitives are commonly used to implement data synchronization.

-from Synchronization (computer science) - Wikipedia

12446 questions
4
votes
2 answers

How is the critical section associated with every Object initialized?

When you say lock (obj) ... .NET uses the critical section in obj to synchronize the following statements. How is this critical section initialized? (e.g. is it initialized at construction time, or lazily?)
user541686
  • 205,094
  • 128
  • 528
  • 886
4
votes
2 answers

How to prevent static methods being accessed by multiple Servlet Threads at once

here is the code I used for deleting and renaming lots of file inside a directory. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;…
divz
  • 7,847
  • 23
  • 55
  • 78
4
votes
4 answers

JavaScript Library to Synchronize Events

let's say I'm doing 3 ajax calls and I want to wait for the 3 calls to finish before doing something. Is there a library out there to synchronize multiple async events in JavaScript ? (using or not jQuery's event system) Ex.: var sync = new…
4
votes
1 answer

iCloud - How to save archive containing array of custom objects

I have developed a small app that stores locally in iOS through archiving an array of custom objects containing: @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *dateCreated; @property (nonatomic, copy)…
Will
  • 303
  • 3
  • 9
4
votes
0 answers

CUDA Thread communication and synchronization mechanisms

I am a bit confused about the thread communication and synchronization mechanisms provided by CUDA. Can someone help me to verify my assumptions below ? Threads within a warp communicate using shared or global memory and synchronize using implicit…
nurabha
  • 1,152
  • 3
  • 18
  • 42
4
votes
3 answers

Why does this threaded code hang

In the below code, when I execute the producercon class, sometimes the execution stucks, looks like a deadlock. But if i make the get_flag () synchronized then there are no such problems. I cannot figure out how there can be a problem. the flag…
phoxis
  • 60,131
  • 14
  • 81
  • 117
4
votes
3 answers

java synchronization and exception handling

If I have a synchronized block and somewhere inside that block an exception is thrown that is not caught within the synchronized block, would the lock be relinquished when the exception propagates out of it?(the synchronized block) synchronized(…
shawn
  • 4,063
  • 7
  • 37
  • 54
4
votes
2 answers

Two generals' agreement

I am trying to figure an agreement protocol on an unreliable channel. Basically two parties (A and B) have to agree to do something, so it's the two generals' problem. Since there is no bullet-proof solution, I am trying to do this. A continuously…
4
votes
2 answers

Can I execute TDataSet.DisableControls in worker thread without wrapping it with Synchronize()?

First of all, I am not sure that it is a good design to allow worker thread to disable controls. However, I am curious can I do it safely without synchronization with GUI? The code in TDataSet looks like this: procedure…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
4
votes
4 answers

Code for syncing the iPhone with REST-servers

is there any open source code for syncing an iPhone with a server (preferably REST)? Found nothing on github and google code. Regards...
Stefan
  • 28,843
  • 15
  • 64
  • 76
4
votes
1 answer

How to do bidirectional sync between Android SQLite and SQL Server

Hello, I want to know if there is any way to synchronize my SQLite database in Android to a SQL Server database in the main server in an automated way. I'm new to Android development and I've been using SQL Server replication in the past with my…
Luis Mejia
  • 151
  • 2
  • 8
4
votes
1 answer

Automatic synchronization via rsync

I need to keep my code synchronized with the same code on virtual machine. Is there a way to monitor file changes and automatically call rsync or something like that?
Ivan Ivanov
  • 2,042
  • 1
  • 19
  • 28
4
votes
1 answer

Java Multi-Threaded Server logic, Synchronized keyword, issue

I am creating a client-server application in java which will allow a number of people, using a client side swing application, (a notepad) to connect to a server. Once connected, each client will have to request control of the notepad so they can…
4
votes
2 answers

Two-way mySQL database sync between hosted and local production server

So the scenario is this: I have a mySQL database on a local server running on Windows 2008 Server. The server is only meant to be accessible to users on our network and contains our companies production schedule information. I have what is…
Johnny Mnemonic
  • 187
  • 1
  • 2
  • 8
4
votes
2 answers

locking c# using private variables

according to Eric Gunnerson Don’t Use lock(this) Use lock(typeof()) Do Lock on a private variable, not on something the user can see Use “object key = new object()” if you need a private key to lock on what is the reason??
Hussein Zawawi
  • 2,907
  • 2
  • 26
  • 44