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

Java Concurrency with Atomic Class

As I know operations on Atomic classes of Java concurrency API are executed one after one when trying to execute the same operation from multiple threads, the output of the following program seems inconsistent to me. public class…
iamcrypticcoder
  • 2,609
  • 4
  • 27
  • 50
4
votes
1 answer

Futex throughput on Linux

I have an async API which wraps some IO library. The library uses C style callbacks, the API is C++, so natural choice (IMHO) was to use std::future/std::promise to build this API. Something like std::future Read(uint64_t addr, byte* buff,…
kreuzerkrieg
  • 3,009
  • 3
  • 28
  • 59
4
votes
1 answer

What is the difference between semaphore and mutex in implementation?

I read that mutex and binary semaphore are different in only one aspect, in the case of mutex the locking thread has to unlock, but in semaphore the locking and unlocking thread can be different? Which one is more efficient?
Boolean
  • 14,266
  • 30
  • 88
  • 129
4
votes
3 answers

How does mutex or semaphore wake up processes?

I read that mutexes and semaphores maintain a list of waiting processes and wake them up when the current thread completes the critical section. How do mutexes and semaphores do that? Doesn't they interfere with the process scheduler decisions?
Boolean
  • 14,266
  • 30
  • 88
  • 129
4
votes
1 answer

Does future::wait() synchronize-with completion of the thread of execution by async()?

It's said that thread::join() synchronizes-with completion of the corresponding thread of execution. I'm wondering whether the same applies to async() and future::wait(). So for example: std::atomic_int v(0); std::async( std::launch::async, [&v]…
Lingxi
  • 14,579
  • 2
  • 37
  • 93
4
votes
1 answer

CouchDB db-per-user with shared data scalability

I have an application with the following architecture: The master couchdb is required to share data between the users. EG: If user-1 writes data to the cloud, this replicates to the master and back to user-2 and user-3. However, as the user base…
4
votes
2 answers

android emulator time synchronization

Is there some way to synchronise emulator time and system time with milliseconds accuracy? So the call System.currentTimeMillis() would return the same time as call gettimeofday() in C?
esmeralda2
  • 169
  • 10
4
votes
1 answer

Synchronization on Set element in java

I have a set of unique elements. Each element have a set of operations that it can perform but each element operations are independent of other element operations. For instance there are three operations : O1, O2, O3 that each element can perform.…
ashishgupta_mca
  • 578
  • 6
  • 27
4
votes
1 answer

Get steady_clock and system_clock at the same time

My Code looks like: // Next 2 lines should be at the same time auto nowMonotonic = std::chrono::steady_clock::now(); auto nowSystem = std::chrono::system_clock::now(); // Do some calc with nowMonotonic and nowSystem This can happen: auto…
powerpete
  • 2,663
  • 2
  • 23
  • 49
4
votes
4 answers

Writing a service to keep two folder in sync?

I need to keep synchronized two folder on different host in Windows. I really think that something already done exists but I did not find anything (SyncToys is not an option), do you have something to suggest me? Requirements are: running as a…
Felice Pollano
  • 32,832
  • 9
  • 75
  • 115
4
votes
5 answers

Not able to synchronize process using Thread

I was testing my skills over Thread behavior. When I implemented Runnable interface and synchronized the run method, I got absolute result. But, when I extend Thread class, the result was unpredictable. Below are the two cases. I think, threads in…
JPG
  • 1,247
  • 5
  • 31
  • 64
4
votes
5 answers

C# threading and synchronization

I have a private static field which I use for synchronization (lock). Now I have two functions which I don't want to execute concurrently. So I did this: public class Synchronization { private static object _lock = new object(); public…
Tux
  • 77
  • 1
  • 2
  • 10
4
votes
1 answer

How do I integrate abook with a carddav server?

I'm running Nextcloud, and my contacts are synced to my laptop with vdirsyncer, which leaves me with a directory full of .vcf files. I'd like to abook to be able to read and edit those but I'm not quite sure how to make that happen. Is that even…
Amanda
  • 12,099
  • 17
  • 63
  • 91
4
votes
2 answers

synchronising MS DB and CouchDB, CouchDB and PouchDb in C#

I have got a MS DB with some data about some customers and I want to develop an application which can run offline, therefor I read that CouchDB and PouchDB can sync to each other How can I synchronise the data from a MS DB to a CouchDB, what's the…
brandart
  • 219
  • 1
  • 9
4
votes
2 answers

How to synchronize consumers with rabbitmq

I have the following problem: I have a RabbitMQ cluster, a messages producer and a cluster of consumers (for high availability). Whenever a consumer is receiving the message it is spawning another process based on the message content and running…
Mat
  • 2,378
  • 3
  • 26
  • 35
1 2 3
99
100