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

How to synchronize threads?

I used threads in this code. but when I execute this code in shell, some threads didn't print this line. printf("\ti'm %dth thread:)", j); printf("\t%c %d %d %d \n", arr[j].op, arr[j].byte, seq, no_file); In addition, even some threads print…
manut
  • 113
  • 1
  • 2
  • 7
4
votes
0 answers

iPhone - Apple Watch Sync (WatchOS 6) via CloudKit problem - Silent push notification

I watch the WWDC video regarding keep iPhone and independent watch app (watchos 6) in sync. So I have made a simple cloudkit subscription on the Apple Watch on a record (watch os 6). 1) On the iPhone I modify the record, but when the iPhone is…
4
votes
5 answers

How to make a concurrent iterator over some source?

I would like to have an iterator that can be read by multiple threads concurrently so that I can process the data of the iterator's source in parallel. The challenge is that I can't really couple hasNext() with its logical next() as those could go…
Gene Golovchinsky
  • 6,101
  • 7
  • 53
  • 81
4
votes
1 answer

Is synchronization needed between multiple draw calls with transparency in Vulkan?

I'm in the processing of learning Vulkan, and I have just integrated ImGui into my code using the Vulkan-GLFW example in the original ImGui repo, and it works fine. Now I want to render both the GUI and my 3D model on the screen at the same time,…
Chlorie
  • 829
  • 4
  • 10
4
votes
1 answer

Syncing Core Data: iOS to OSX, vice versa

I'm exploring my options for syncing Core Data from iOS apps to OSX, and vice versa. I just watched a presentation on zSync as a possible option, but noticed it's not really updated anymore. Does anyone have any preferred solutions for…
Zakman411
  • 1,764
  • 3
  • 22
  • 45
4
votes
2 answers

Condition variable vs mutex in C++ std

I do not understand the difference between a condition variable and a mutex. In my opinion, it's not described clearly enough. Can someone explain it independently of any programming language? And a C++ std specific explanation as well?
tempacc987
  • 41
  • 1
4
votes
2 answers

Android account sync interval change in preferences

Hi I am implementing an account sync adapter and i am trying to make a preference screen in settings under Account and Sync for the user to be able to change the sync interval. what i want to know is how can i make the adapter sync at the specified…
DArkO
  • 15,880
  • 12
  • 60
  • 88
4
votes
2 answers

how to query my database and have it be outputted on a Google Sheet so that someone can edit this data and then have it reflected back in MySQL?

I’d like to push some data from MySQL into Google Sheets. Once I’ve edited my data in Google Sheets, I’d like to push my edited data back into MySQL. Ideally, I’d even like to schedule it to update it every hour, so my data is always live and…
4
votes
3 answers

What are the costs of a condition variable?

Assume that unused execution resources are available on the machine in question, i.e. not all CPUs are being utilized. If a thread is waiting on a condition variable, what are the costs associated with waking up this thread? Similarly, what are…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
4
votes
1 answer

Why 'wait with predicate' solves the 'lost wakeup' for condition variable?

I am trying to understand the difference between spurious vs lost wakeup in case of a condition variable. Following is small piece code I tried. I understand that 'consumer' in this case could wake up without any notification and therefore the wait…
4
votes
1 answer

Is it safe to access VT data from the other thread?

Is it safe to change VirtualTreeView data from the secondary thread ? And if yes, should I use critical sections (or even Synchronize method) ? I'm afraid that when I'll be writing to the VT's data record from the other thread, main thread invokes…
4
votes
1 answer

Can I access a mutex created by a windows service from a user application?

I'm creating a named mutex in a windows service that needs to be accessible from regular applications. So far I create the mutex with a name similar to Global\< GUID >. Right now I get an unauthorized access violation when I try to open the mutex…
Nathanael
  • 1,782
  • 17
  • 25
4
votes
1 answer

How to update Android contact company?

I recently created a Sync adapter for my app, It will sync contacts I am getting via a web request with the contacts in the phone. I have no problem adding the contact, however I cannot get the contact information to correctly update when contact…
4
votes
2 answers

Wait for java async call to complete

I have a async function that calls other async function. In Java, how to wait on untill the async call completes(including any nested async calls in it). I already Future callable But no luck. Sample code: void asyncMehodA(){ } void asyncMethodB()…
Sandy K
  • 65
  • 1
  • 1
  • 8
4
votes
2 answers

Silverlight HttpWebRequest syncronous call

In my silverlight app I do a file upload. I break the file into chunks and then I upload each chunk. The problem is that I want to use the HttpWebRequest synchronously. My propblem is to ensure that all request are ok and to catch exceptions. Is…
Radu D
  • 3,505
  • 9
  • 42
  • 69