tagged [synchronization]

How does @synchronized lock/unlock in Objective-C?

How does @synchronized lock/unlock in Objective-C? Does @synchronized not use "lock" and "unlock" to achieve mutual exclusion? How does it do lock/unlock then? The output of the following program is o...

31 Jul at 23:16

How do 2 or more threads get synchronized using a timer in the Windows kernel?

How do 2 or more threads get synchronized using a timer in the Windows kernel? I have been reading about the kernel using timers for thread synchronization. I haven't been able to find a decent explan...

Creating a Cross-Process EventWaitHandle

Creating a Cross-Process EventWaitHandle I have two windows application, one is a windows service which create EventWaitHandle and wait for it. Second application is a windows gui which open it by cal...

7 Apr at 06:26

Is there a synchronization class that guarantee FIFO order in C#?

Is there a synchronization class that guarantee FIFO order in C#? What is it and how to use? I need that as I have a timer that inserts into DB every second, and I have a shared resource between timer...

14 Aug at 06:42

Volatile DateTime

Volatile DateTime As `DateTime` cannot be declared as `volatile`, is this right? That property could be accessed from different threads, so I want to ensure they get always the latest version

Wait until all Task finish in unit test

Wait until all Task finish in unit test I have this class I want to unit test: And this is how my unit test looks like: ``` [TestMethod] public

Monitor.Wait, Condition variable

Monitor.Wait, Condition variable Given a following code snippet(found in somewhere while learning threading). ``` public class BlockingQueue { private readonly object sync = new object(); pr...

13 Jun at 06:38

Is Microsoft Sync Framework alive?

Is Microsoft Sync Framework alive? According to the MS documentation Sync Framework Toolkit ([https://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e](https://code.msdn.microsoft.com/Sync-Fram...

What is threading context?

What is threading context? Does a thread's context refer to a thread's personal memory? If so, how is memory shared between multiple threads? I'm not looking for code examples- I understand synchroniz...

node.js execute system command synchronously

node.js execute system command synchronously I need in function that will execute the given command line and return all stdout'ed by that command text. > ps. Sync is wrong. I know. Just for personal u...

Lock (Monitor) internal implementation in .NET

Lock (Monitor) internal implementation in .NET For mastering of some technology you have to know how it's made at one abstraction level lower. In case of multithreading programming, it will be good to...

Best practice for synchronizing a changing List of the model to a ObservableList of the ViewModel?

Best practice for synchronizing a changing List of the model to a ObservableList of the ViewModel? I have an (external) model exposing a List that constantly changes (let's say every two seconds or so...

Mutex example / tutorial?

Mutex example / tutorial? I was trying to understand how mutexes work. Did a lot of Googling but it still left some doubts of how it works because I created my own program in which locking didn't work...

is there anyway to provide a ics Calendar file that will automatically keep in sync with updates

is there anyway to provide a ics Calendar file that will automatically keep in sync with updates i see using [this calendar library in C#](http://www.ddaysoftware.com/Pages/Projects/DDay.iCal/) that i...

21 Nov at 19:20

How to wait on another process's status in .NET?

How to wait on another process's status in .NET? I'm working on an integration testing project in .NET. The testing framework executable starts a service and then needs to wait for the service to comp...

3 Oct at 13:45

What is the difference between atomic / volatile / synchronized?

What is the difference between atomic / volatile / synchronized? How do atomic / volatile / synchronized work internally? What is the difference between the following code blocks? Code 1 Code 2 ``` pr...

Design: How to inform controllers about data modification across application

Design: How to inform controllers about data modification across application In a big system mvc-based there are views responsible for editing data and views that display that data. Example: `UserMana...

is "Double-Checked Locking is Broken" a java-only thing?

is "Double-Checked Locking is Broken" a java-only thing? the page at [http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html](http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleChecked...

fs.writeFile in a promise, asynchronous-synchronous stuff

fs.writeFile in a promise, asynchronous-synchronous stuff I need some help with my code. I'm new at Node.js and have a lot of trouble with it. What I'm trying to do: 1. Fetch a .txt with Amazon produc...

Synchronised requests enforced from ServiceStack 3 configuration

Synchronised requests enforced from ServiceStack 3 configuration I have an ASP.NET application, using NGINX as a server and Servicestack 3. When it comes to PUT requests, I'd like them to be synchrono...

Do I need to Dispose() or Close() an EventWaitHandle?

Do I need to Dispose() or Close() an EventWaitHandle? If I am using `EventWaitHandle` (or `AutoResetEvent`, `ManualResetEvent`) to synchronise between threads then do I need to call the `Close()` or `...

What is the proper way to take an item from a BlockingCollection?

What is the proper way to take an item from a BlockingCollection? When calling BlockingCollection.Take() it is possible for the IsCompleted status of the collection to change between the check of IsCo...

How to protect resources that may be used in a multi-threaded or async environment?

How to protect resources that may be used in a multi-threaded or async environment? I am working on a C# API that is used by a variety of consumers. This API provides access to a shared resource (in m...

Why did Java and C# add intrinsic lock to every object?

Why did Java and C# add intrinsic lock to every object? Making every object lockable looks like a design mistake: 1. You add extra cost for every object created, even though you'll actually use it onl...

31 Aug at 05:31

MS Sync Framework and SQL Server Compact

MS Sync Framework and SQL Server Compact I develop a Windows C# application which can work in Online and Offline mode. When in Online mode it connects to a SQL Server. In Offline mode it connects to a...