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
5 answers

Primitive synchronization primitives -- safe?

On constrained devices, I often find myself "faking" locks between 2 threads with 2 bools. Each is only read by one thread, and only written by the other. Here's what I mean: bool quitted = false, paused = false; bool should_quit = false,…
zildjohn01
  • 11,339
  • 6
  • 52
  • 58
4
votes
3 answers

critical section in php between all requests

I am making a website in php, in which I want to sell some charge-numbers. For each request, I have to do these operations atomic: Asking database for an available charge-number marking the charge-number as sold increasing a number (in a file or…
Saeed
  • 7,262
  • 14
  • 43
  • 63
4
votes
2 answers

iOS5 File Sharing: recognize when files have been added to a Directory?

as the title says i wanna know how i can recognize that new file have been added to my App for example over an iTunes Sync. In iOS4 i used the methods - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary…
Rale Kay
  • 51
  • 4
4
votes
3 answers

EXTJS 4.0 : how to implement callback method for store.sync() method?

I am using Extjs 4.0 , and I need a callback method for store.sync() method? Does anyone have a solution? Thanks a lot!
nothing
  • 61
  • 1
  • 3
4
votes
7 answers

PHP + MySQL Deployment

I'm just trying to find an easier way to deploy a site I'm working on. I'm working alone with a test a production server and right now deployment means copying a subset of the files and database data onto my computer and uploading it to the prod…
Godwin
  • 9,739
  • 6
  • 40
  • 58
4
votes
1 answer

Global named event equivalent in Unix

What is the global named event object equivalent in Unix? I need to create a named event-like object in unix so that another process can set it pseudocode in Win32: HANDLE hEvent=CreateEvent(...,"Global\\CSAPP"); while(1) { …
JosephH
  • 8,465
  • 4
  • 34
  • 62
4
votes
3 answers

How to implement synchronization with timers in C#

I have a scenario where my C# class has two methods say DoThis() and DoThat() that are called independent of each other, in any order, by an external caller. The two methods need to be synchronized in the following way: After a call to DoThis(),…
amo
  • 315
  • 4
  • 14
4
votes
7 answers

Why does enumerating through a collection throw an exception but looping through its items does not

I was testing out some synchronization constructs and I noticed something that confused me. When I was enumerating through a collection while writing to it at the same time, it threw an exception (this was expected), but when I looped through the…
adeel825
  • 5,677
  • 12
  • 40
  • 44
4
votes
3 answers

Does puting a block on a sync GCD queue locks that block and pauses the others?

I read that GCD synchronous queues (dispatch_sync) should be used to implement critical sections of code. An example would be a block that subtracts transaction amount from account balance. The interesting part of sync calls is a question, how does…
Centurion
  • 14,106
  • 31
  • 105
  • 197
4
votes
6 answers

Synchronization problem

public class PingPong implements Runnable { synchronized void hit(long n) { for (int i = 1; i < 3; i++) System.out.print(n + "-" + i + " "); } public static void main(String[] args) { new…
Android Killer
  • 18,174
  • 13
  • 67
  • 90
4
votes
1 answer

Clearcase multisite vs Gitlab.... anything?

The company I work for uses Clearcase, even though it was EOL'd on the platforms in which we run it years ago. It is ancient and fragile tech, but one thing it does have is a multisite support that allows for the synchronization of air-gapped repos.…
Juan Jimenez
  • 443
  • 4
  • 18
4
votes
2 answers

Google Contacts Api -> Which contacts were deleted?

I am parsing contacts from Gmail, and creating a sync functionality with my product. But on my script i'm having a hard time determining which contacts get 'deleted' from gmail. EXAMPLE: If I have John Doe in my Application, along with Gmail...…
Justin
  • 2,502
  • 7
  • 42
  • 77
4
votes
3 answers

Does a mutex still need to be released if it times-out?

Using the WaitForSingleObject Function. If the function is called and times out, does it still need to release the mutex? i.e. should ReleaseMutex be in position 1. or 2. if the five seconds elapse? WaitForSingleObject(5 second time out) { …
T.T.T.
  • 33,367
  • 47
  • 130
  • 168
4
votes
1 answer

Using optimistic locks in C++ and memory order

I'm wondering how 'optimistic locks' (as described e.g. here: https://db.in.tum.de/~leis/papers/artsync.pdf) can be used in C++ with regard to non-atomic data and what memory orders should be used. My understanding from the above paper is that…
Igor
  • 1,307
  • 1
  • 10
  • 19
4
votes
2 answers

best/simplest way to keep multiple (non-bare) Git repos in sync

I have several non-bare Git repositories. There is one central Git repository (or at least handled as being the central repo; this might change) but this is also non-bare (because I want to have a checkout on the same machine). My history is mostly…
Albert
  • 65,406
  • 61
  • 242
  • 386