synchronization

What is most CPU efficient method to make the worker threads wait for tasks?

In my current C#/NET 3.5 application, I have a task queue (thread safe) and I have 5 worker threads that has to constantly look for tasks in the queue. If a task is available, any one worker will dequeue the task and take required action. My worker thread class is as follows: public class WorkerThread { //ConcurrentQueue is my impl...

AS3: Shared Objects Issue

Slight problem i have been pondering on, i have a class that loads a text from a url as a means to sync the time. The swf file can be on the same page multiple times, but i want it to check to see if one of the swf is sync'ing, if so then wait for it to complete and load its sync'd value (rather then query the url itself), so that they ...

Does c# and java have the same sychronization issues/concepts?

I'm just learning java, and I find that the java docs/books put a strong emphasis on synchronization. I have read quite a bit of c# docs/books, and you just don't see that much emphasis on this topic. Does c# handle locking/sychronization differently, or do things work differently as a web application (application pools, iis, clr verus...

Using DTO Pattern to synchronize two schemas ?

I need to synchronize two databases. Those databases stores same semantic objects but physically different across two databases. I plan to use a DTO Pattern to uniformize object representation : DB ----> DTO ----> MAPPING (Getters / Setters) ----> DTO ----> DB I think it's a better idea than physically synchronize using SQL Query on e...

pthreads mutex vs semaphore

What is the difference between semaphores and mutex provided by pthread library ? ...

What is the threading class if I just want to test and set a flag in a threadsafe manner?

I just want to do a simple, though thread-safe, boolean test (and set) so: if(myBoolean==false) //should not lock/wait! { myBoolean=true; ..... } else { .... } I considered the following (although possibly incorrectly, so please correct me where I misunderstood) using the Lock { if(myBoolean)... } construct seems ...

Approach for implementing synchronization?

The data will be kept on a server and on a client, say a desktop app. Clients will have a local "cache" and this is editable. Use cases: - The server side copy is edited, send to clients. - The client side copy is edited, send to server. I am thinking of giving the information an incremental value. Each time an edit takes place, it i...

wait and notify in C/C++ shared object

How to wait and notify like in Java In C/C++ for shared memory between two or more thread?I use pthread library. ...

What is the story with shared data synchronization using the MS AJAX 4.0 client library?

Consider a LOB site, where users work on a large shared dataset. Using Wcf Data Services on the server side and the DataContext and DataView from the AJAX 4.0 client library on the client side to enable CRUD operations. Getting the data on the initial load is straight forward, just query the server and display the data (in a table for e...

Ways to synch many (small) files over high-latency network connection

We typically deploy our software applications to our clients using Subversion (svn update on the clients; unidirectional). We're currently experiencing problems with one of our clients because of the high latency (large file download speeds are good) because they are in China and our server is in Canada. Subversion simply times out with ...

are there any different levels of synchronization?

Hi, I have heard that there are different levels of Synchronization.are there?(If there are ,would you please explain them with a snippet code?)thanks. ...

what does synchronization mean?

Hi, would you please explain more about the meaning of synchronization? ...

.NET memory model, volatile variables, and test-and-set: what is guaranteed?

I know that the .NET memory model (on the .NET Framework; not compact/micro/silverlight/mono/xna/what-have-you) guaranteed that for certain types (most notably primitive integers and references) operations were guaranteed to be atomic. Further, I believe that the x86/x64 test-and-set instruction (and Interlocked.CompareExchange) actuall...

Sql Server Compact Edition version error.

I am working on .NET ClickOnce project that uses Sql Server 2005 Compact Edition to synchronize remote data through the use of a Merge replication. This application has been live for nearly a year now, and while we encounter occasional synchronization errors, things run quite smoothly for the most part. Yesterday a user reported an err...

Efficiently synchronizing warehouse information

Ok, let's see if you Wizards can help me with this problem I'm banging my head against. The scenario is a pretty standard setup with a point of sale (that's where I am) and a backoffice keeping track of warehouse information. The problem is that I need to synchronize the database at the point of sale with the current stock information f...

How to run two functions simultaneously

Hello, I am running test but I want to run 2 functions at the same time. I have a camera and I am telling it to move via suds, I am then logging into the camera via SSH to check the speed the camera is set to. When I check the speed the camera has stopped so no speed is available. Is there a way I can get these functions to run at the s...

What's the best way to do one-way synching from a server-side database to iPhone?

I've got a database on my server which is about 3mb big. I'd like to ship that with my iphone application. The most important thing is that I'd like to promote changes to the database (insert, updates, deletes) to the iphone. What's the best way of doing that? I mean - what is necessary on - the server - the client (= iphone) - between;...

Sync Eclipse project between Linux and a windows computers

Hey guys, My situation is like this: I got a windows computer and a Linux computer , and an Eclipse project I'd like to sync between them. What is the best way to do this ? Thanks in advance ...

Synchronize 2 databases installed locally with Xampp

Hi there, I've 2 computers connected to Internet. Each one has Xampp installed, with a local mysql database. Is it possible to sychronize these 2 dbs ? I use Navicat. The sync works well with a local database to a server database, using tunneling. But what about the sync between 2 PCs dbs ? Thank you very much for your help, Cheer...

How to synchronize a static variable among threads running different instances of a class in java?

I know that using the synchronize keyword before a method brings synchronization to that object. That is, 2 threads running the same instance of the object will be synchronized. However, since the synchronization is at the object level, 2 threads running different instances of the object will not be synchronized. So, if we have a static ...