synchronization

Why does LogicalCallContext not work with async?

江枫思渺然 提交于 2019-12-03 05:44:29
问题 In this question the accepted answer by Stephen Cleary says that LogicalCallContext can't work correctly with async. He also posted about it in this MSDN thread. LogicalCallContext keeps a Hashtable storing the data sent to CallContext.LogicalGet/SetData. And it only does a shallow copy of this Hashtable. So if you store a mutable object in it, different tasks/threads will see each other's changes. This is why Stephen Cleary's example NDC program (posted on that MSDN thread) doesn't work

Difference between event object and condition variable

狂风中的少年 提交于 2019-12-03 05:09:16
问题 What is the difference between event objects and condition variables? I am asking in context of WIN32 API. 回答1: Event objects are kernel-level objects. They can be shared across process boundaries, and are supported on all Windows OS versions. They can be used as their own standalone locks to shared resources, if desired. Since they are kernel objects, the OS has limitations on the number of available events that can be allocated at a time. Condition Variables are user-level objects. They

Resource locking with async/await

房东的猫 提交于 2019-12-03 04:45:59
问题 I have an application where I have a shared resource (a Motion system) which can be accessed by multiple clients. I have individual Operations that require access to the system for the duration of the move and which should throw 'Busy' exceptions if conflicting operations are requested at the same time. I also have Sequencers which need to acquire exclusive access to the Motion system for the execution of several Operations, interspersed with other actions; during the entire sequence, no

How can I make my Docker compose “wait-for-it” script invoke the original container ENTRYPOINT or CMD?

霸气de小男生 提交于 2019-12-03 04:45:00
According to Controlling startup order in Compose , one can control the order in which Docker Compose starts containers by using a " wait-for-it " script. Script wait-for-it.sh expects both a host:port argument as well as the command that the script should execute when the port is available. The documentation recommends that Docker Compose invoke this script using the entrypoint: option. However, if one uses this option, the container will no longer run its default ENTRYPOINT or CMD because entrypoint: overrides the default. How might one provide this default command to wait-for-it.sh so that

PTP sync on windows server (compared to i.e. Linux) - what precision can be guaranteed

谁说我不能喝 提交于 2019-12-03 04:00:18
I would like to know if everyone knows how precise PTP synchronization can be guaranteed on Windows Server 2008. I know about this thread: What is the minimum guaranteed time for a process in windows? which discusses windows' native time and yes, this does not give any guarantees at all. But what when it comes to hardware solutions (PTP)? Are there any limitations preventing a guarantee of < 1ms? I know the processes depending on the time will be competing for CPU time but if the process DOES have CPU time when needed, are there anything else the might come in the way? EDIT 1: I added "

sync databases Mysql SQLite [duplicate]

落爺英雄遲暮 提交于 2019-12-03 03:54:34
This question already has answers here : How to sync SQLite database on Android phone with MySQL database on server? (5 answers) Possible Duplicate: how to sync SQLite database on android phone with MySQL database on server? I am wondering what is the best approach to updating a database on an Application. We have a mysql database that handles everything on the main server, but I want to replicate this on my app. I would like to copy the database (mysql) on the android device so that both stay up-to-date. this would not have to happen in real time, but could be scheduled once every week, or

Out-of-order writes for Double-checked locking

蹲街弑〆低调 提交于 2019-12-03 03:50:45
In the examples mentioned for Out-of-order writes for double-checked locking scenarios (ref: IBM article & Wikipedia Article ) I could not understand the simple reason of why Thread1 would come of out synchronized block before the constructor is fully initialized. As per my understanding, creating "new" and the calling constructor should execute in-sequence and the synchronized lock should not be release till all the work in not completed. Please let me know what I am missing here. The constructor can have completed - but that doesn't mean that all the writes involved within that constructor

Windows API to trigger the time synchronization

橙三吉。 提交于 2019-12-03 02:55:08
Is there a windows API that would achieve the equivalent of clicking the "Update now" button in the "Date and time properties"/"Internet time" tab (opened by double clicking the clock in the taskbar)? Is there a way to monitor when the time synchronization is triggered by windows and when it succeeds or fails? There is no API exposed by the time service, but to trigger a time synchronization you can use the w32tm command line tool. In C/C++ you can do something like this: include <process.h> ... system("w32tm /resync /nowait"); Take a look at w32tm documentation for further options. This seems

Command-line/API for Schema Compare in SSDT SQL Server Database Project?

偶尔善良 提交于 2019-12-03 02:45:01
问题 In Visual Studio 2012, we have Schema Compare in SSDT's SQL Server Database Project (DbProject) project which helps Compare source versus target Update target to make it the same as source Where Source and target can be either a database, a DbProject project, or a .dacpac file Update can be done via an update action or generated script My question is that is it possible to have and where can I get the command-line/API interface to call this feature? 回答1: SOURCE Database sqlpackage.exe /a

Alternatives to iCloud + Core Data to sync data between iOS and OS X

醉酒当歌 提交于 2019-12-03 02:44:24
I'm developing an application for iOS/OS X and i want to sync data between them. for now I use Core Data for persistent data. I read that iCloud is not enough mature to use with core data. Is that true ? so i try to use the new DropBox sync API(to sync the SQLite file), but there's no support for OS X. Is Parse SDK a good idea? (it will also allow me to add Android support) If no, have you other solution? Thank you. i read that icloud is not enough mature to use with core data. is that true ? Yes, I've worked with it quite a bit but I cannot recommend it at present. so i try to use the new