Questions tagged [synchronization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
13 views

Breadth first event synchronization based on a frequency or time series

I have an interesting and problem I'm facing. I'm trying to maintain a set of metrics independently based off of a time frequency. Note: This is a simplification of the problem I've omitted pieces of ...
1
vote
1answer
40 views

Synchronizing Multiple Local SQL databases with Server

I'm trying to understand what general mechanisms and/or concepts are available in SQL database last to synchronize local. Here are my inputs and requirements. Multiple clients have a full copy of the ...
1
vote
2answers
46 views

Calling an API and synchronising database

I am calling a payments API to send a payment. At the same time, I need to mark the payment as sent in my database. If I call the API first, then the database crashes, the payment will be sent twice. ...
0
votes
0answers
34 views

What is best approach to designing a local-to-cloud cloud-to-local Infrastructure?

I plan to have a cloud web application(CWA) and several local web application(LWA), let's assume 3 LWAs and 1 CWA. CWA === LWA. This web application would consist of a database server, file storage ...
0
votes
3answers
81 views

Is it possible to solve this synchronization problem using mutex and conditional variables?

I am trying to solve this synchronization problem in C to practice for my lectures of Operating Systems where we use POSIX and Linux. I've been trying for days to find an approach to this problem with ...
3
votes
2answers
194 views

Hexagonal/Clean Architecture - threads, locks, synchronization

All the examples across the internet try to pretend that every application is run on a single thread. There is no problem with synchronization, multithreading etc. Uncle Bob, in his "Clean ...
0
votes
3answers
488 views

Why do we need read locks in read-write locks?

in read-write locks, why do we need read locks since processes can read a file at the same time? Would only a write lock suffice? Thanks.
1
vote
1answer
37 views

Poll based database operations with a load balanced application

I have a .NET Core application that is hosted as multiple load balanced instances (separate servers, obviously pointing to the same database). I have written a service within the application that ...
1
vote
2answers
89 views

Do critical section and atomicity imply each other?

Is it correct that In concurrent programming, a critical section is a sequence of statements which can't be executed by more than one processes/threads at the same time. Atomicity (as "A" ...
0
votes
1answer
121 views

Why does a condition variable's wait() release the associated mutex before blocking and reacquire it before returning?

Stallings' Operating System book says about condition variable in Solaris, A condition variable is used to wait until a particular condition is true. Condition variables must be used in ...
-2
votes
2answers
168 views

How to syncronize one object from two sources

I want to synchronize one variable (Node.Value) to two separate sources. Both sources can read or write to their internalValue variable. How do I keep track of the newest value and update ...
-4
votes
3answers
135 views

What is “it is possible for one process to lock a binary semaphore and for another to unlock it” useful for?

Here are some discussions about mutex (lock) and binary semaphore from two OS books. Stalling's Operating Systems book says A concept related to the binary semaphore is the mutex . A key ...
0
votes
1answer
122 views

Is a mutex lock always implemented as spin waiting?

Is a mutex lock always implemented as spin waiting? Can a mutex lock be implemented as block waiting? (Operating System Concepts section 5.4 only mentions the implementation by spin waiting. See below....
1
vote
2answers
262 views

Why is it that “the process that locks the mutex must be the one to unlock it ”?

Here are some discussions about mutex (lock) and binary semaphore from two OS books. Stalling's Operating Systems book says A concept related to the binary semaphore is the mutex . A key ...
0
votes
1answer
180 views

Is there still busy waiting in the process-blocking implementation of a semaphore?

Operating System Concepts discusses two implementations of a semaphore, by busy waiting in Section 5.5 and by blocking the current process in Section 5.6: Section 5.5 A semaphore S is an integer ...
1
vote
1answer
138 views

Does a safe state not lead to a starvation state?

In Operating System Concepts: 7.5.1 Safe State A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a ...
0
votes
1answer
97 views

Why does “producers and consumers check availability before getting the mutex” avoid deadlock?

In Little Book of Semaphores: 4.1.6 Finite buffer producer-consumer solution Finite buffer consumer solution 1 items.wait () 2 mutex.wait () 3 event = buffer .get () 4 mutex. signal () 5 spaces . ...
22
votes
5answers
3k views

Is “releases mutexes in reverse order” required to make this deadlock-prevention method work?

Operating System Concepts says 7.4.4 Circular Wait The fourth and final condition for deadlocks is the circular-wait condition. One way to ensure that this condition never holds is to impose a total ...
4
votes
4answers
161 views

How to understand the first and second readers-writers problems?

Computer Systems: a Programmer's Perspective says The readers-writers problem has several variations, each based on the priorities of readers and writers. The first readers-writers problem, which ...
0
votes
0answers
40 views

Offline app with syncing features with React Native

I am currently building an ordering application where users can send orders for available items. It must have the functionality to work offline as well. After user is online, the user has the sync ...
-1
votes
1answer
51 views

Efficiently keep different data structures synchronised - tree, list of objects

Problem description I have a pet project to translate TEI XML to standoff JSON and back: https://github.com/standoff-nlp/standoffconverter and I am currently thinking about a rewrite/restructuring. ...
2
votes
3answers
168 views

When does a *fixed delay* make sense?

Every now and then I see someone delaying an action by a certain number of milliseconds to ensure it is working. Something like: doSomethingInHtml(); timer.schedule(100); // delay for 100 milliseconds ...
-4
votes
1answer
50 views

Difference between inter-thread and inter-process sharing and synchronization

A) I know that threads of a process share logical address space . Therefore they share data by default. B) But if two threads of different processes want to share data ...then there are two options ...
0
votes
1answer
113 views

Is it a standard practice to have a single application/controller writing to database

I've been interviewed by some experienced engineer, when he strongly disagreed with some statements I said: Assuming full control over your applications, It's a standard practice to make writes-to-...
-1
votes
1answer
51 views

Design solution for updating different lists with common items

I needed some design suggestions for a tricky workflow we have to implement in our system: At a basic level the application allows users to work on a "list" of "items" she cares about To work on any ...
1
vote
1answer
141 views

How do ISRs and user threads synchronize and share data?

My question is more of educational than an actual coding problem. I tried searching the web, but got little help. I am trying to learn how to write ISR and understand how they interact with user ...
-3
votes
2answers
77 views

How to scale an application where every read results in a write?

So I am trying to design a simple URL shortener application where every time a URL is queried, it is going to update the number of times it has been queried. I'm thinking of using MongoDB and I am ...
3
votes
1answer
73 views

Synchronizing video playback in LAN over UDP (no master, same HW & SW)

I have devices thay play video files from their local disk basing on a pre-defined playlist (every device plays exactly the same movie in the same order, every device knows in advance what videos will ...
0
votes
1answer
105 views

Need to test for equality on vector clocks

I've heard about vector clocks and how to test if a message was sent before another message. E.g. Message A was sent before message B if every element of the vector of message A is smaller or equal ...
0
votes
2answers
900 views

Race condition in Distributed Systems

We have a set of micro-services that are functionally dependent and have intertwined validation logic. e.g. consider 'Credit-Card' service and 'Loan' service. When user has a credit card then loan ...
0
votes
1answer
293 views

Does the producer-consumer problem appear in both shared memory and distributed memory architectures?

I saw some books on operating system concepts mention the producer-consumer problem in the context of synchronizing concurrent accesses to shared resources. All seem to be in shared memory ...
-5
votes
1answer
70 views

As a developer who runs a small business , can i integrate Quickbooks POS with Shopify

I am a senior developer with C# knowledge, and i have developed many console applications and web applications which integrate with external systems using APIs. now i run my small business and i have ...
0
votes
3answers
49 views

Offline Synchronisation with Changing Access Rights

We got a distributed application where a client syncs certain data portions to its offline storage and performs modifications on it. The data is structured in container entities "Container" and ...
0
votes
1answer
84 views

Launch threads continuously with predefined interval between threads

I'm currently using a third-party API to fetch results, using a REST client (Retrofit). The problem is that the amount of requests per second that I can do to the API is limited with interval: I can'...
1
vote
2answers
64 views

Data Synchronization: How can I keep a parent record updated with its child totals efficiently?

I have an application that returns projects. A Project has many Tasks each Task has a field called hours. A project returns the total hours for all the Tasks that belong to it. My application ...
-2
votes
1answer
122 views

Map synchronization algorithm

Say I have two Map instances in JavaScript (or HashMap in Java, or Dictionary in C#), A and B. I want to synchronize B to A, so that B is a copy of A. I can't copy the reference and I don't want to ...
7
votes
3answers
8k views

How to justify using await instead of .Result() or .Wait() in .NET Core?

Since the inception of .NET Core, console apps, function apps, ASP.NET etc. are not using synchronization context in async methods (so they're synchronizing straight to Thread Pool). This means that ...
0
votes
0answers
53 views

How to generate object Ids for both local and online storage?

My application has both offline (SQLite) and online (iCloud) storage. See: Offline First: How Do I Fetch Data? Now, as stated in my past question above, the application is offline first, and I'm ...
1
vote
1answer
105 views

Offline First: How Do I Fetch Data?

I'm new to this community, I'm glad I found this and so I can ask questions like this one (as per https://meta.stackexchange.com/questions/68384/whats-the-difference-between-stack-overflow-and-...
0
votes
1answer
80 views

Are there pitfalls to using only a remote database for a mobile app?

My research indicates that the ideal database design is: Mobile App -> Local Database -> Syncing -> Remote Database using something like PouchDB to do the data replication/syncing. But ...
0
votes
0answers
33 views

How to arrange synchronicity reporting in an eventually consistent, distributed system?

Context: A typical corporate landscape with many systems located in different data centers, with firewalls, without uniformised interfacing. Some data X is being replicated for availability and ...
0
votes
1answer
79 views

Reliable data synchronisation between several systems

We have several systems that hold the same data in different databases. The requirement is to keep the data synced in as much reliable way as possible. Performance isn't a concern because we don't ...
5
votes
2answers
2k views

Synchronization of data across microservices

We have 2 to 3 dozen microservices that serve our customers. These services are deployed in a Kubernetes cluster, and they're only accessible to the outside world through 3 or 4 API gateways. We ...
2
votes
1answer
151 views

Generic way to describe data synchronization between systems?

Is there a generic way (useful formalisms) to think about data synchronization between two systems, especially in the case of slightly asymmetric roles (eg, one system contain master data, another one ...
1
vote
3answers
557 views

What are criteria for enterprise to have multiple databases (for new project)?

We are working on new enterprise project (multiple activities - online ordering, offline ordering, b2b ordering, accounting processing, secure payment processing, analysis and dynamic pricing and so ...
1
vote
2answers
182 views

Synchronize multiples REST api, centralized into 1 web application

I am developing a web application for a client, connected to 4 differents sources : E-commerce website CRM Emailing platform Surveys platform All the sources have REST Api's. The web application ...
1
vote
1answer
111 views

How state updates to existing instances/sessions are generally done?

This is a very broad question, but maybe someone has a worthwhile response. There is a general synchronization issue that often has to be solved, but always seems to be difficult. Here's an example: ...
-1
votes
1answer
236 views

Synchronization method vs private final object for locking in java

Can anyone tell me which one is better approach between synchronization method and private final object in java and why ?? public class kclass { private final Object myObject = new Object(); ...
1
vote
0answers
42 views

Client synchronization of authentication tokens in parallel connections

In my app server's authentication implementation, an authentication token is generated for every user that has logged in. According to some highly recommended security tips (Implementing Secure User ...
2
votes
1answer
764 views

Best practices for app-cloud synchronization of database representation

I'm planning a cookbook-like Android app that would let users store/add/edit their e-juice recipes, keep track of the ingredients, etc. Internally, I'll be storing the data in a database on the user's ...