synchronization

Could SynchronizationContext be used not in WinForms/WPF application?

I'm writing a component that would be used in WinForms or WPF applications also could be used in Windows services or Unit tests. Is there a way to use SynchronizationContext component in non UI apps? ...

.NET: Send a text message to all instances of the same application and read it

I need ability to reliably sync some chunks of textual data between all running instances of my application. What's the best way to make it? ...

Git and Beanstalk

Hello, I'm experimenting with Git... I've found Beanstalkapp suits my needs. I've created individual repositories for EACH client on Beanstalk and then pushed all the files from a machine at work. I've created repositories for each client and my Beanstalk account now looks like this: Client One (repository)<br> --a load of files and f...

How to use wait and notify protocol with multiple threads

Specifically, can somebody tell me what is wrong with this piece of code. It should start the threads, so should print "Entering thread.." 5 times and then wait until notifyAll() is called. But, it randomly prints "Entering.." and "Done.." and still keeps waiting on others. public class ThreadTest implements Runnable { private int n...

C# Synchronize Wait / Poll methods.

I have a class that exposes two methods:  - GetObject Gets a single object, or returns null if there are none.  - WaitForObject Gets a single object, or waits until their is one. An example implementation:      class MyClass     {         MyStack stack;         public object GetObject()         {             return stack.Pop()...

WCF Client-Server Synchronization: Polling vs. Binding

I am working on WCF client-server app. where the client has to be constantly synchronized with the server (at least every 10 seconds). At the moment I'm polling the server to see if anything has changed. If so, the changes (sometimes tens of db records) are pulled down to the client. My design felt a bit clunky so I had a look at how g...

SyncStagedProgressEventArgs converted to DbSyncSessionProgressEventArgs

I am working on an app that is using Synchronization Framework v2. I am basically done with it, but would like to offer some better fedback about the progress of the synchronization. I was looking at one of the Synchframework examples that Microsoft offers, SharingAppDemo-CEProviderEndToEnd, and see that the have a method in the Progress...

How would you design & implement a Cross Platform synchronization mechanism ?

How would you design, architect and implement a Cross Platform synchronization mechanism ? Targeted Platforms : Windows, Windows Mobile 6.5 & 7, Iphone, MacOs X, Android It's for synchronizing a very simple desktop CRUD app. Please note that I've got nothing running in a cloud, that's why I'm wondering if I can't capitalize on an exis...

Scala actor to non-actor interaction (or synchronizing messages from an actor to a servlet)

I have the following scala code: package dummy import javax.servlet.http.{HttpServlet, HttpServletRequest => HSReq, HttpServletResponse => HSResp} import scala.actors.Actor class DummyServlet extends HttpServlet { RNG.start override def doGet(req: HSReq, resp: HSResp) = { def message = <HTML><HEAD><TITLE>Rando...

Java synchronized blocks

Hi, I want to ask the following: If we have a method e.g. public void doSomething(){ synchronized(this){ //some code processing here } String temp = "init"; //instead of i++ synchronized(this){ //some other code processing here } } is this method equivalent to public synchronized void doSomething()? I mean, ...

Syncing development environment between OSX and Windows

Hi, I currently have a portable XAMPP server on a USB flash drive so I can develop on either my desktop or my laptop. However, recently I bought a mac laptop, but I'm still using Windows on the desktop. Now I can't use the USB flash drive trick to code anywhere. What method would you suggest to have two local development environments ...

Synchronizing client-server databases

I'm looking for some general strategies for synchronizing data on a central server with client applications that are not always online. In my particular case, I have an android phone application with an sqlite database and a PHP web application with a MySQL database. Users will be able to add and edit information on the phone applicat...

ISynchronize->Reset() fails with error result 0x80010120

When I run the following code: ISynchronize *sync_p; res = CoCreateInstance(CLSID_StdEvent, NULL, CLSCTX_INPROC, IID_ISynchronize, (LPVOID *)&sync_p); if (!SUCCEEDED(res)) _com_issue_error(res); res = sync_p->Reset(); The final line fails with error code 0x80010120 - "There are no synchronize objects to wait on...

Replication framework for iPad/iPhone

I need peer-to-peer replication for an iPad application (MonoTouch or SDK). The best thing would of course be suggestions.... But also hints about where to look. Normally this would be a feature of the database, but perhaps with the IOS model (multi-processing etc) it would have to be a library for my application? Would it be much the...

MySQL database sync for workstation developement/testing

I need a local copy of our production database, and I need to refresh it every few days so testing and development is not working with terribly stale data. A few days old is just fine. Here is the pseudo plan: Write a script on the Production server that mysqldump's + gzip the database. Add a cron process to run the script every othe...

How to synchronize databases in different servers in SQL Server 2008?

I have 2 databases that have the same structure, one on a local machine and one on the company's server. Every determined amount of time, the data from the local DB should be synchronized to the server DB. I have a general idea on how to do this - create a script that somehow "merges" the information that is not on the server DB, then m...

Should this be a synchronized method?

I'm using TestNG to run tests in parallel and want to be careful about possible synchronization issues with helper classes and utilities. To my knowledge, each test is its own object, transparently created by the test runner. Thus, I don't need to worry about synchronizing anything non-static, since it would be an object created in a Thr...

Safe way to capture state of Application?

If I have an Application like this: Class Application { List state1 = new ArrayList(); Map state2 = new HashMap(); } And I have a RPC service run in an other thread that uses to report the state of Application(such as: how many item in state1, which are containing in state2 keys). What's the best way to do that? I'm...

C# multiple sources, different threads, one event handler

Hi guys, I need somebody with high skills in threading and event raising. I have an abstract class A and two concrete classes C1, C2 (e.g plugins). Since I need them to communicate between each other, like "plugin-application" "plugin-plugin" communication, I have a method ExecuteCommand in the abstract class which should accomplish...

how can I do in android sync setting in android 2.1.

I am working in android sync setting, but I could not resolve those problems 1.how to set the auto sync, I had called android API, but not useful: ContentResolver.setMasterSyncAutomatically(false); call this AIP method although, android emulator can auto sync in background. 2.when sync finshed , how can I catch the response of the e...