synchronization

CUDA: synchronizing threads

Almost anywhere I read about programming with CUDA there is a mention of the importance that all of the threads in a wrap do the same thing. In my code I have a situation where I can't avoid a certain condition. It looks like this: // some math code, calculating d1, d2 if (d1 < 0.5) { buffer[x1] += 1; // buffer is in the global mem...

Strategy for syncing data with mobile phones?

We built a .NET server application that hosts data (contacts, email, etc.). We'd like to sync our data to mobile devices: iPhone, Windows Mobile, Blackberry, etc. How should we go about doing this? Build several mobile apps, one for each platform (e.g. app for iPhone, app for Blackberry, etc.), each app syncs with our server. License ...

How to add data sync (Google docs) ability to iPhone app?

I would like to enable my iPhone app's data to sync with Google docs. How can this be done? What other sync'ing options do I have (another one I am aware of is EverNote Sync Server)? ...

Synchonization in Java

Hi, Quick question. I am pretty new to thread-safe programming, and was wondering if I have something like below, would this be safe from deadlock once compiled and run? public class Foo { protected CustomClass[] _mySynchedData = new CustomClass[10]; public void processData() { synchronized(_mySynchedData) { ...

Time Synchronization Code

I'm writing some code that needs to know how much out of sync the client and the single server's time are. I'm trying to do it by creating a temp file on a SMB share hosted on the server and reading of its last modified time. I thought (maybe incorrectly) that the timestamp would be generated by the server and not the client. since it s...

how to sync audio in iphone sdk with NStimer?

I am running a countdown timer which updates time on a label.i want to play a tick sound every second.i have the sound file but it is not sync perfectly with time.how do i sync time with audio?also if i use uiimagepicker the sound stops how to manage this? if someone have tick sound like a clock has it would be great. ...

synchronization database for windows application in vb.net

i have a windows application made in VB.NET which maintains a database, and i have similar application running across many disconnected machines, all of them have similar databases. Now we have a requirement that all the data from these machines must be uploaded on a central database server MSSQL on a daily basis, we can have an internet...

How to synchronize and combine results from multiple threads in C++?

I have a data feed continuously feeding data packet in. There are 5 threads(A, B, C, D, E) processing the data packages. Note the 5 threads have totally different speed and they generate 5 different features(each thread generate 1 feature) for every incoming data package. The 5 threads are at different pace: when A has finished analyzin...

message queue. msgsend msgrcv. System V IPC system calls in C (Linux)

Hi I'm working with some shared memory where different processes read and write data. I'm using a message queue to store messages of when data has changed between read and write operations. /* struct that defines a message */ struct msgbuf{ long mtype; /* must be positive */ int childId; //ID of child sending message ...

Synchronize online SQL Server 2008 databases

As I found this can be done with merge replication in SQL Server. But I have only one main server and many small ones(with Express edition installed on them). Let me explain: There is the main (big) office with SQL Server Standard edition installed on its server. And there are many offices across the country with with their own small ...

How To Mutex Across a Network?

I have a desktop application that runs on a network and every instance connects to the same database. So, in this situation, how can I implement a mutex that works across all running instances that are connected to the same database? In other words, I don't wan't that two+ instances to run the same function at the same time. If one is...

Cached data Synchronization to Database

What are the best ways to keep data synchronized between in memory cache and the database when used in a web application? Specifically, I store large amounts of database data in an in-memory cache using EHcache on my web application. For many interactions, I would like to simply modify the value in cache, and only synchronize it with the...

Strict alternation in the C programming language (from Tanenbaum)

Why isn't the test in strict alternation for the first entrance for process 0 while ( turn == 0) //then enter How can process 0 enter while (turn != 0), is'nt this the same as while (turn == 1) ? turn = 0; //process 0 to enter while (TRUE) { while (turn != 0) critical_region(); turn = 1; noncritical_region(); } //process 1 t...

Correct pattern for multi-thread synchronization? (C#)

I have two threads referencing the same variable -- the UI thread and a timer thread. As such, I have wrapped access to it in lock statements in both threads. The timer thread's access has priority -- if it's using the variable and the UI thread also wants access, I want the UI thread's operation to complete, but only after the timer t...

Oracle database synchronization

Here is the context : I have database A on one server, which is used from internal production. And database B on another server which provide some of the database A's information to a web site. A is updated internally, and B can is updated by the website's client. What is the best solution to keep an intégrity between both database? ...

Shared POSIX objects cleanup on process end / death.

Hi, Is there any way to perform POSIX shared synchronization objects cleanup especially on process crash? Locked POSIX semaphores unblock is most desired thing but automatically 'collected' queues / shared memory region would be nice too. Another thing to keep eye on is we can't in general use signal handlers because of SIGKILL which ca...

Synchronising SQL database through ADO.Net

Hi, The problem that i'm having is how can i synchronise my datasets in my VS 2008 project to any changes in the database. As you know we read data from the db into the dataset which is disconnected, now lets say 1 minute later something updates the data in the database. What i want to do is after a set time interval check the db for...

Syncing Objects for a Socket/Network Connection -- Best Practice Not Using WCF?

What's a good way to sync objects over a socket connection? Here's what I've thought of so far. An object, in its getters and setters, calls an Update method that transfers all of the class's information over the socket connection to other connected clients. To update these changes on the clients, a overloaded method is called that bas...

Flex application loading and synchronicity

I know there are a lot of questions that have been asked about synchronicity in Flex, but I'm not sure if any cover the same issue I'm having. The title only refers to one possible solution I've been going for with this, but essentially here's my situation: Say I have a Flex application, and I have an XML file with configuration setting...

AutoResetEvent, ManualResetEvent vs Monitor

Lets say i have to orchestrate a synchronization algorithm in .net 3.5 SP1 and any of the synchronization primitives listed in the title fit perfectly for the task. From a performance perspective, is any of those more performant than the other? I ask this because I have been coding for a while now, but without proper knowledge on the s...