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

Native method synchronization

I have a native method method defined like this: public static native int doSomething(); However, this method is not thread-safe. So, I put a synchronized keyword on it, so it looks like this now: public static synchronized native int…
rm5248
  • 2,590
  • 3
  • 17
  • 16
5
votes
2 answers

Why is this piece of C++ code not synchronized

I am learning to write multithreading applications. So share I run into trouble anytime I want my threads to access even the simples shared resources, despite using mutex. For example, consider this code: using namespace std; mutex…
ukaku
  • 191
  • 1
  • 11
5
votes
2 answers

Drawing from multiple threads in Qt

I'm writing a program in Qt, which runs 10 worker threads which calculate the trajectory of an object in space. They also have to draw the path of the object. I have a "Body" class deriving QGraphicsEllipseItem and it has a QPainterPath in it. The…
Losiowaty
  • 7,911
  • 2
  • 32
  • 47
5
votes
2 answers

How to implement offline capable Single Page Application with Breeze.js and HTML5 local storage

I have working Single Page Application using Breeze.js for Data Access. It uses the Breeze.js to execute queries against the local cache and the data is requested only once at start up. Only the data updates are posted back on the server…
5
votes
2 answers

Multiple producer multiple consumer thread issue

I have a program in which I am trying to implement a multiple-producer, multiple-consumer setting. I have code which seems to work well when I have one consumer and multiple producers, but introducing multiple consumer threads seems to raise a few…
filpa
  • 3,651
  • 8
  • 52
  • 91
5
votes
2 answers

How to manage number of threads inside Sync Task

What i am looking for is to find a way to manage a number of threads inside the Asyntask. I need to sync my local database with server updates. This might be large data that can be retrieved using paging. Can anybody tell me what is preferred way…
5
votes
4 answers

How to synchronize Google Calendar & Spreadsheet with Script

I am trying to create a Google Apps Script that keeps a Google Calendar and a "master spreadsheet" on Drive synchronized -- is this possible? I found these two…
5
votes
2 answers

cudaStreamWaitEvent does not seem to wait

I am attempting to write a small demo program that has two cuda streams progressing and, governed by events, waiting for each other. So far this program looks like this: // event.cu #include #include #include…
Markus-Hermann
  • 789
  • 11
  • 24
5
votes
1 answer

What's the most efficient way to periodically sync data in a PostgreSQL DB?

I have a table in my PostgreSQL 9.0.x DB called cached_projects which I primarily access via a Rails app, whose schema looks like this: create_table "cached_projects", :force => true do |t| t.string "name", :null =>…
Stuart M
  • 11,458
  • 6
  • 45
  • 59
5
votes
2 answers

Monitor class implementation in c++11 and c++03?

Herb Sutter describes implementation of template Monitor class in "C++ and Beyond 2012: Herb Sutter - C++ Concurrency": template class monitor { private: mutable T t; mutable std::mutex m; public: monitor( T t_ ) : t( t_ ) {…
belobrov.andrey
  • 109
  • 1
  • 4
5
votes
1 answer

SyncAdapter only on WIFI

I want to run my SyncAdapter only on Wifi. In the beginning of onPerformSync, I can check if wifi is present. If it's not, I want to postpone it until there is WIFI available. I know of syncresult.delayUntil but that means that the sync adapter is…
Catalin Morosan
  • 7,897
  • 11
  • 53
  • 73
5
votes
3 answers

.NET File Sync Library

Is there a good .NET file syncing library? It can be pretty basic and only needs to work on local and mapped drives (no server client model like rsync is needed). And yes, I know there is the MS Sync Services, but that is a lot more than what I…
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
5
votes
3 answers

How can I synchronize two MySQL tables that have different structures?

I am migrating from one system to another and in the process, I will be running both systems concurrently. I need to be able to synchronize uni-directionally from one table to another while maintaining each table's primary keys. In this example, I…
Dooltaz
  • 2,413
  • 1
  • 17
  • 16
5
votes
5 answers

Play a sound, wait for it to finish and then do something?

I'm writing a Windows Forms application which is supposed to play three sound files and at the end of each sound file, it's to change the source of an image. I can get it to play the sounds using System.Media.SoundPlayer. However, it seems to play…
Omar Kooheji
  • 54,530
  • 68
  • 182
  • 238
5
votes
1 answer

Zero permit semaphores?

I'm trying to use the first response to this question to help me on an assignment I'm working on. How exactly does a Semaphore with 0 permits work? It doesn't really seem to make much sense to me. Is it just to create an eternal wait at that…
Hoser
  • 4,974
  • 9
  • 45
  • 66