synchronization

Java: Synchronization Utility

I am asking this purely to determine the worthwhile-ness of implementing the class in Question ... Do you know of a Java utility class that takes an un-synchronized instance, uses reflection to investigate that instance, and returns the input instance "wrapped" within synchronized calls ? ( ie: A factory which creates a synchronized de...

When should each thread synchronization objects be used?

Under what circumstances should each of the following synchronization objects be used? ReaderWriter lock Semaphore Mutex ...

How do I keep my world data in synch in a multi-threaded game engine?

So I'm trying to create a simple multi-threaded game engine for the game I want to write. So far, everything has worked without any problems, I even know what steps I have to take to finish it. There is only one thing I don't know (well, technically, I know a solution for it, but I'm hoping there is something more elegant and faster): B...

Android: Enable/Disable Auto Sync and Background Data

I want to develop an application that disable the Background Data (new feature in Android 1.5) and Auto Sync and then enable GPRS/EDGE connection and vice versa. I figured out how to enable/disable GPRS/EDGE by changing the APN settings. (weird solution. However; Android developers couldn't think a user may want to disable GPRS/EDGE) B...

Synchronizing the code and class views in Visual Studio?

I really like Visual Studio as an IDE, but there are a few things about it that really bug me. Namely, its class view. Not only is the class view tree structure cluttered, but it's not synchronized to the code view. I know there's a way of manually synchronizing them, but can't this be automated like it is in Netbeans? ...

Windows Mobile Synchronization Error

Hi guys, I am new to Windows Mobile development and have been investigating methods to synchronize data between PDA's running WM6 and a SQL Server 2005 Database. After some research I decided to go with Windows Synchronization Services. I started by looking at the sample: SyncServicesForDevicesSample I downloaded and installed all ...

What is the consensus number for semaphores?

(I think that) the consensus number for a mutex is 2. What is the consensus number for semaphores (like in pthread_sem_*)? What is the consensus number for condition variables (like in pthread_cond_*)? ...

Threading/Synchronization

What is the real difference Conceptually and Implementation point of view between Semophore, Mutex, Monitor? We say Semophores are resource allocation counter... OK I understand this.. For Mutex we say mutex are Binary Semophore... Gosh what's that??? Monitor guards the entry point for an objects... i.e. only one thread can acquire i...

How do you avoid duplication of validation on the server and client-side?

How do you avoid duplication of validation on the server and client-side? Is there a web programming platform that generates one from the other, so I don't have to keep the two in sync? ...

Primitive synchronization primitives -- safe?

On constrained devices, I often find myself "faking" locks between 2 threads with 2 bools. Each is only read by one thread, and only written by the other. Here's what I mean: bool quitted = false, paused = false; bool should_quit = false, should_pause = false; void downloader_thread() { quitted = false; while(!should_quit) { ...

Is there a tool to monitor synchronisation objects (mutex, events, semaphores) in Windows?

In Windows, is there a tool to monitor the status of process synchronisation objects? ie. event/mutex : signaled or not signaled semaphore : count Better yet, to log which thread did what, eg. "thread #5421 Signal Event - testevt" ...

java anonymous classes and synchronization and "this"

hi all, I am dealing with a race condition, I believe, in my JAVA GUI. I have some methods that create an "anonymous method" inside an anonymous class like this: synchronized foo() { someMethod(new TimerTask() { public synchronized run() { //stuff } }; } QUESTION: is that...

Code for syncing the iPhone with REST-servers

Hey, is there any open source code for syncing an iPhone with a server (preferably REST)? Found nothing on github and google code. Regards... ...

What is the scope of cache flushing required by Java's synchronize keyword?

I have been researching the Java Memory Model all day today, in order to understand in detail the problems with the JMM pre-Java 5 and the changes made by JSR-133 implemented in Java 5. What I cannot seem to find a definitive answer on is the scope of cache invalidation and flushing required on a particular synchronize. Must all CPU re...

How many synchronization objects can be used per process and per machine in Windows?

It's highly likely that there is a limitation on how many synchronization objects - semaphores, events, critical sections - can one process and all processes on a given machine use. What exactly is this limitation? ...

synchronizing objects ID in app & web database?

Hi, We have an Android app and a Web Service. We want to download part of the places objects to the mobile. The user will be able to download more of a certain city. Because of that we need to save the city_id of the web in the mobile database. We've thought on two options: Each database will have it own primary IDs, but we will save ...

Avoid Deadlock using Non-virtual Public Interface and Scoped Locks in C++

I've run into a problem which seems troubling to me. It seems I've found a situation that's easy enough to work-around, but that could lead to problems if a) I have a lapse in concentration while programming or b) somebody else starts implementing my interfaces and doesn't know how to handle this situation. Here's my basic setup: I've...

Looking for good analogy/examples for monitor verses semaphore.

A monitor is supposed to solve problems with semaphores in concurrent environments. I'm looking for a good analogy using a monitor verses semaphore. Please use information for the analogy: 4 tasks (TaskA, TaskB, TaskC, TaskD) 1 variable varX Each Task wants to manipulate varX based on some event. ...

Advanced SQL Data Compare throught multiple tables

Hello, Consider the situation below. Two tables (A & B), in two environments (DEV & TEST), with records in those tables. If you look the content of the tables, you understand that functionnal data are identical. I mean except the PK and FK values, the name Roger is sill connected to Fruit & Vegetable. In DEV environment : Table A 1 Ro...

JavaScript synchronization options.

Hi, I was wondering whenever exists a solution to perform synchronization in JavaScript code. For example I have the following case: I'm trying to cache some response values from AJAX call, the problem is, that it's possible to perform simultaneously several calls, therefore it leads to race condition in the code. So I'm very curious to ...