Click here to Skip to main content
15,885,000 members
Everything / Synchronization

Synchronization

synchronization

Great Reads

by honey the codewitch
Take control of which thread your code gets executed on, and how it does
by JadBenAutho
Efficient and standalone library for NTP server/client utilizing pure C++
by David Deley
Explain by analogy the difference between a Synchronous Wait and an Asynchronous await
by ipavlu
The Cross-Platform Object-Oriented approach to Synchronization Primitives for .NET and .NET Core based on one shared pattern between two interfaces for General Threading and Async/Await.

Latest Articles

by JadBenAutho
Efficient and standalone library for NTP server/client utilizing pure C++
by George Swan
An explanation of the code execution pathways in an application that employs a TaskCreationSource to correlate activity between its threads
by David Deley
Explain by analogy the difference between a Synchronous Wait and an Asynchronous await
by DavesApps
A way to catch / prevent race conditions in multithreaded code

All Articles

Sort by Score

Synchronization 

28 Jul 2020 by honey the codewitch
Take control of which thread your code gets executed on, and how it does
2 Mar 2024 by JadBenAutho
Efficient and standalone library for NTP server/client utilizing pure C++
13 Nov 2023 by David Deley
Explain by analogy the difference between a Synchronous Wait and an Asynchronous await
24 Mar 2019 by ipavlu
The Cross-Platform Object-Oriented approach to Synchronization Primitives for .NET and .NET Core based on one shared pattern between two interfaces for General Threading and Async/Await.
15 Apr 2023 by DavesApps
A way to catch / prevent race conditions in multithreaded code
27 Feb 2021 by honey the codewitch
Using a popular RTOS to enable easy multithreading on your IoT gadgets
24 Jan 2022 by ryanovic
An implementation of a basic Reader-Writer lock using only the System.Threading.Monitor class
17 May 2017 by Afzaal Ahmad Zeeshan
Since, you already have a web application why don't you just go away and create an API in your own application; if I had to do this, I would definitely, do it like this. This would have various benefits, you won't need to expose your API keys for application to everyone who uses your...
24 Mar 2019 by ipavlu
The Cross-Platform Object-Oriented approach to Synchronization Primitives for .NET and .NET Core based on one shared pattern between two interfaces for General Threading and Async/Await.
15 Aug 2016 by KarstenK
It is better to send some batches as transactions and get a commit that they are saved/done and than proceed. You need to protect against any failures, like network timeout or any other, like invalid data. It is very important that the integrity of the data is ensured. Transactions need a commit...
15 Feb 2021 by Richard Deeming
//We need to read the response stream from the beginning... response.Body.Seek(0, SeekOrigin.Begin); //...and copy it into a string string text = await new StreamReader(response.Body).ReadToEndAsync(); text = CustomRes(text);...
24 Sep 2021 by Member 12885549
I have to check unsynchronized and synchronized methods and I decided to do that with following problem: let's say there're two purses and I am adding money to one, , adding to other. When thread is not synchronized I expect not correct values...
4 Jul 2016 by Shvetsov Evgeniy
I am previously used both volatilce cv AND std::atomic class separtaley, now i'm wonder, should i am combine them in order to ensure the proper access?In general, assuming i have some global-static atomic flag, whether it would be std::atomic OR std::atomic_flag, doesn't really matter...
4 Jul 2016 by KarstenK
Yes. And you should implement both operators. Pay attention, that the volatile type needs some syncronization details to ensure atomic access.
15 Aug 2016 by Mahmoud_Gamal
Specs Big data with minimum 10 thousand transaction in 10 h and 300 nodes at first stage every table in symmetric scope has update insert delete trigger architecture methods 1-one corp send data via direct DB Connection with to other mediators (nodes) (one service) 2-one corp send...
16 Feb 2017 by Garth J Lancaster
Your question isn't clear as to whether you want to write a client from scratch or use an existing client - iirc, Dropbox has a client you can install on your machine to sync a folder to the cloudIf you with to build your own client, then you're looking at something like...
27 Mar 2017 by Jochen Arndt
Why should a thread delete a global object?Objects should be only deleted by the owning thread. With global objects this is probably the main thread.Because it contains a mutex, there should be no need to delete the object. Just let it exist during the lifetime of the application.If...
21 Jun 2017 by soulessing
I try  use the Microsoft.Synchronization.SyncOrchestrator.Synchronize() for Mirror my source database instance To my destination database(using sql server 2014, VS 2017). Always I can see successfully end of Synchronize(), When the Synchronization is First time. But After I change the...
4 Jan 2018 by Sachin Makwana
I'm working on a project, where I need to sync the databases [i.e. Remote-DB and Local-DB]. for this I'm using microsoft sync framework. I'm using Download and then Upload method to sync the databases. While Download method I'm able to get the dataset of a table. I want to set a flag...
23 Sep 2017 by Member 13426014
I'm writing a program that creates two threads. Each thread is responsible for reading through one text file, with one char on each line. The first is formatted like: h 0 h 0 ... The second is formatted like: 0 i 0 i 0 i Sometimes there can be multiple letters after each other, or multiple...
23 Sep 2017 by Patrice T
First thing to do is to use the debugger and make sure everything is as expected. Inspect variables as they change. Check everything until only the mutex remain as explanation of problem. There is a tool that allow you to see what your code is doing, its name is debugger. It is also a great...
4 Jan 2018 by RDBurmon
Its possible but not through flag, you will get separate table which Sync framework updates in-between the sync activity In order for SQL Server to track the changes made to the database, the database is modified to add a table with the _tracking suffix for each table to be synchronized, plus...
28 May 2018 by Member 13801581
i have two ListBoxAdv1 and ListBoxAdv2 and i want sync them scroll i used this code and just shown scrolled up or down but didn't update screen and items in another ListBoxAdv what should i do? please help What I have tried: i try this: private void listBoxAdv1_Scroll(object sender,...
28 May 2018 by Member 13801581
thanks for many response! i find solution: bool Scrolling = true; private void listBoxAdv1_Scroll(object sender, ScrollEventArgs e) { if (Scrolling == true) { Scrolling = false; listBoxAdv2.BeginUpdate(); ...
3 Oct 2018 by #realJSOP
Getting a schema for an entire database (which I seriously doubt is what you really want) requires quite a bit of planning and code, especially if you also want to get all of the related database components associated with that database. The answer to your question is WHOLLY outside the scope of...
20 Oct 2018 by @k5hu
I came across these terms and I'm a bit confused about the differences. What I have tried: While searching for explanations I found few more terms like "Hold and Wait", "No preemption", "critical section" which made me more confused. Could anyone explain me the differences among Mutual...
20 Oct 2018 by Richard MacCutchan
This is how you do it; Mutual Exclusion - Google Search[^]
13 Dec 2018 by Gerry Schmitz
Yes; you display the (new) .gif in the "ProgressChanged" handler (because it runs on the caller's UI thread versus DoWork which "is" the background worker thread). And you have to call "ReportProgress" (to invoke ProgressChanged) from DoWork; it doesn't run by itself.
29 May 2019 by Gerry Schmitz
Quote: It has to be web-based and preferably in Java. You need to do a "feasibility study", and then decide on the technology.
26 Aug 2020 by chrispdraycott
I am looking at IPC between .NET and C on Linux. I have managed to get some shared memory working using: C shm_open and mmap C# MemoryMappedFile I need a mechanism though to be able to synchronize the changes between my .NET application and...
26 Aug 2020 by Jeltz1
Using a byte or two in shared memory as a variable for a state machine defining which part C / .Net gets access at what times is most likely your best option. Assuming you have a multi-thread CPU at your disposal, there is no great difficulty...
21 Oct 2020 by DoingWork
I am opening WPF Window from Winforms application in manuItem_ClickedHandler. Step 1: In Constructor of ViewModel I am creating thread and doing some work. In callback event, Value of control is updated successfully. Step 2: I closes this WPF...
9 Jan 2021 by Muhammedcan Pirinççi
Let's say I have 3 kinds of bakery shops.I wanna have a buffer for each one of them.With that way i can control producing-consuming for each bakery shops. How can I implement it to c language with Pthreads? Thanks in advance What I have tried:...
9 Jan 2021 by KarstenK
at first you must learn and understand the basic of C and multi-threading is an advanced theme. Looks like soome pthread tutorial. You can imagine it as some persons are in the kitchen and are cooking together. The biggest problem is to explain...
15 Feb 2021 by Dev Mo
Good day, I have an issue with a custom response in API Gateway Ocelot with Middleware. inside FormatResponse(context.Response) I change response for specific endpoint and I see the new response on debug but I receive the original Response in...
24 Sep 2021 by OriginalGriff
Why should the result be 10 and 200? You start coinThread before you start purseThread1 - so if your system has spare cores it's very likely that coinThread will complete before purseThread1 even starts! Try adding some Console.WriteLine calls...
24 Sep 2021 by mirajanata
The results might be incorrect when two or more threads read and write into the same value or object (memory) without synchronization. Your code creates 2 threads. Each of them works with different object (purse1, purse2). There's no memory...
24 Sep 2021 by Richard MacCutchan
Console.WriteLine($"Purse 1: {purse1.Total}"); Console.WriteLine($"Purse 2: {purse1.Total}" + Environment.NewLine); ^ should be purse2
24 Sep 2021 by Dave Kreskowiak
Why would the results be 10 and 200? Look at your Add() code in the Purse class. You're adding from 1 to
24 Sep 2021 by George Swan
I am not sure what you are trying to do but if you wish to update a shared variable from different threads, here are a couple of suggestions. For simple operations like addition or incrementing use the Interlocked class, it is very efficient. ...
7 Jan 2024 by George Swan
An explanation of the code execution pathways in an application that employs a TaskCreationSource to correlate activity between its threads
3 Mar 2019 by MehreenTahir
This article is a continuation of Programming Concurrency in C++ Part 1. We will discuss synchronization, future and promises along with async and with that, will sum up the introduction of concurrency in C++.
29 Jan 2023 by Oleg_100
Synchronize access to multiple objects by name (string)
21 Oct 2022 by Bruno van Dooren
This article shows how to use a win32 mutex during application startup to figure out if an application instance is the first one.
6 May 2021 by ipavlu
The goal of the Unified Concurrency is to unify access to different synchronization primitives in object-oriented fashion with one pattern and two interfaces for general and async/await methods.
25 Feb 2021 by honey the codewitch
Take a page from .NET and enjoy an easy way to safely pass information between threads on an ESP32
15 Aug 2016 by Tacitonitus
Method 1 is superior for the following reasons:1) You can use threads to handle concurrency which, in Windows at least (you didn't specify the OS), is a highly developed, trustworthy, and efficient mechanism for handling either synchronous or asynchronous task allocation. Your method 2, on...
21 Jan 2021 by ipavlu
The goal of the Unified Concurrency is to unify access to different synchronization primitives in object-oriented fashion with one pattern and two interfaces for general and async/await methods.
1 Mar 2022 by Uladzislau Baryshchyk
An overview of multithreading in C#
9 Jan 2021 by CPallini
You may find (just Google for) many pthread code samples about the producer-consumer problem. They could be your starting point.
16 Apr 2021 by Chris_Green
Get an event fired by Thread A to execute in the context of Thread B
30 Sep 2018 by Steven Coco
This illustrates a simple pattern that provides a lock that can always be invoked; and may be a no-op for a non-synchronized implementation.
15 Feb 2021 by RickZeeland
Here is a good example of how to use Async and Tasks: Asynchronous programming in C# | Microsoft Docs[^] Also see: Best~model-for-async-programming-in-net[^]
15 Feb 2017 by Srusti Thakkar
Hello All!I need to create a client that will sync local folders to a remote server and i am using dropbox or any other client already created.What are your opinions about what should i use? I have looked on MS Sync Framework but i still haven't found anyone using it over the internet.Any...
27 Mar 2017 by Chandan_srivastava
I have a global object which is shared by different threads. To provide the synchronization, I have added a mutex inside the global object.Mutex will be locked by a thread before accessing the data inside the object.Everything is fine except delete.If a thread is locking the mutex and...
17 May 2017 by Srusti Thakkar
Hello, I want to develop a client just like OneDrive Desktop Client. I have created Web Application. In that I have used OneDrive Rest API to perform basic operations. Now I want to develop a desktop client and perform same action just like OneDrive Desktop Client do. How can I start to...
3 Oct 2018 by Muhammad Hashir Abid
how to compare schema and data of two different databases and synchronize the latest changes in target database through c shrap Code. Note: i'm working on Desktop Application with Sql Server 2014 Explanation: i'm working with Desktop application on visual studio 2013 and sql server 2014. i want...
13 Dec 2018 by TheBigBearNow
So far I haven’t had luck with my loading gif image when I am loading/checking my database connection I click my login button and I get no errors in my login I start my gif but I also start it in the dowork and progress section im not sure which section is actually right I know not to mess wih...