synchronization

Best way to synchronize code on remote server using SCP (SSH-Copy)

For a current course I am taking, we are using a remote computer to run our code (It's a four node cluster, programming with MPI and C++). I am coding locally on my MacBook and I'm looking for a good way to keep my local code up to date on the cluster. The way I was doing it was to have a terminal open for running SCP to copy the d...

C# Synchronized object - duplicate code with writing accessors

I like to use objects which sync itself using a private object which is locked when the property is changed. Is there any generic way to achieve this? My code looks always like this for each property (with one locker object) private Object locker = new Object(); private int x; public int X { get {return x;} set{ ...

Reading data from Flight Simulator

I'm looking at building some hardware components to interface with Microsoft Flight Simulator which (hopefully) will display things that are currently taking up screen real estate (altimeter, airspeed indicator, radios, etc.) Is there a way to read the values they have while FlightSim is running so that I can synchronize the external, h...

How to synchronize threads when polling for state changes with boost

In my application I want to be informed by events, that another application has been started or stopped. I have an existing API to the running application which cannot be changed to accomodate notification which would be the obvious solution. What I have is a function call in the API (isRunning), so I decided to make a polling thread wh...

Pthread conditional signal - not working as expected

I am working on a project and trying to use pthread_cond_wait() and pthread_cond_signal() to synchronize two threads. My code looks something like this: pthread_mutex_t lock_it = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t write_it = PTHREAD_COND_INITIALIZER; int main(int argc, char**argv) { pthread_t t_send_segments, t_re...

How to guarantee a function will not be entered again if it does not return within a thread?

I don't want the function to be entered simultaneously by multiple threads, neither do I want it to be entered again when it has not returned yet. Is there any approach to achieve my goal? Thank you very much! ...

Data Synchronization framework / algorithm for server<->device ?

I'm looking to implement data synchronization between servers and distributed clients. The data source on the server is mysql with django on top. The client can vary. Updates can take place on either client or server, and the connection between server and client is not reliable (eg. changes can be made on a disconnected cell phone, shoul...

iPhone offline application with synchronization

I'm looking into building an application which works just as well offline as it does online. Since the application cannot communicate with the server while in offline, there is some level of synchronization which needs to take place. What are some good tools to read about and start thinking about when planning offline operations with sy...

confused about spin lock

I read spin lock code from here, especially this part inline void Enter(void) { int prev_s; do { prev_s = TestAndSet(&m_s, 0); if (m_s == 0 && prev_s == 1) { break; } // reluinquish current timeslice (can only // be used when OS available and // we do NOT wa...

How to synchronise FTP directory from command line?

I have a website with PHP files and other. I would like to do one-click synchronisation between my local copy of a website and my website on the server. It would be nice if there was be a command line utility or plugin to Eclipse PDT to do this. ...

Synchronizing time, but ignoring time zones.

Hi, I have an application that I want to have a feature where it synchronizes the Windows system clock, but only setting the minutes, unless for example the system time is 13:58 and the time server is 14:02, in which case the hour should be changed too. The thing is, I don't want to use the time server hours/days etc because I want the...

MPI: Locking the stdout -- 1 process at a time?

Hello. I want to print out the content of integer array of each processes. Problem is, it's all cluttered because of race condition. What is the simplest solution? I don't want to debug. I want to show the contents because I'm doing sorting algorithm. So it's useful to show before and after sort. I added this in lock.c: #include <std...

C# Synchronize two objects through events

I have 2 objects. Foo and Bar in two different threads. Now I want to rais an event in Foo but in the thread of Bar. and how can I use SynchronizationContext.Current for that? ...

Java: synchronizing threads across multiple servers

I have a problem where I need to synchronize processing for multiple threads across multiple different servers for a Java service on Windows. In this application, I have multiple consumer threads pullings messages off the same JMS queue. Messages come in in groups of 3 or 4, and I need to make sure the messages in each group are proces...

What .NET ORMs support smart clients (ie object mapping and data synchronization)

I was recently involved in a project that required a smart client. We used SQL Server Compact Edition and Microsoft Sync Services for ADO.NET. Our online server was SQL Server 2005. A quasi-ORM/DAL (very specific to our needs) was handcoded by a member of our team. Creating a custom ORM in this scenario cost us quite alot of development ...

Synchronizing Files Across Multiple Servers

In a farm environment, is there a preferred technique for keeping files created/updated/deleted on one server in sync with all of the other servers in the farm? For example, if a file is created by a user on Server A, and that file is requested by a user on Server B, what is the best way for ensuring that the file is accessible on both s...

iTron data-queue in linux

In iTron there is lighter version of the message-queue called data-queue. They are very easy to use for fast message transfers. Is there any equivalent synchronization primitive in Linux? Definition of data-queue: It is a queue for one word messages ...

Handling Interrupt in C++

Hi all: I am writing a framework for an embedded device which has the ability to run multiple applications. When switching between apps how can I ensure that the state of my current application is cleaned up correctly? For example, say I am running through an intensive loop in one application and a request is made to run a second app ...

Core Data syncing

Hi, is there a way to automatically sync my Core Data Model with a server (preferably REST)? Thanks ...

Why does enumerating through a collection throw an exception but looping through its items does not

I was testing out some synchronization constructs and I noticed something that confused me. When I was enumerating through a collection while writing to it at the same time, it threw an exception (this was expected), but when I looped through the collection using a for loop, it did not. Can someone explain this? I thought that a List ...