synchronization

Throwing exceptions from a Process.Exited handler

I have a program which runs an external, command line utility and reads the standard output (a PNG image.) Originally during testing, I had the command line program write the image to a temporary file, and then loaded the file into the program. I had a handler for Process.Exited which threw an exception if the exit code was nonzero. I ...

Swing: Problem distinguishing between user-induced and automatic components resizing (Writing a custom LayoutManager).

Hello! I'm trying to write an own layout manager. Components must be placed and sized relative to each other. This means: when the user drags or resizes an component, some other components (but not the one altered manually by user) have to be altered. Swing tells the layout manager to layout the components every time when some of them...

Syncing Frames to Audio and channel.position Acuracy

Calling channel.position on an ENTER_FRAME event, I notice that it's not being updated every frame, but it looks more like every frame and a half. var sound:Sound = new Sound(new URLRequest('music.mp3')); var channel:SoundChannel = sound.play(); // assume the sound is completely, // totally, 100...

Future proof file storage

I accept file uploads from users. Each file has a pointer in the db which has info on the file location in the filesystem. Currently, I'm storing the files in the filesystem non categorically, and each file is currently just named a unique value. All categorisation and naming etc is done in the app using the db. A factor that I'm concer...

DBServerSyncProvider SelectClientIdCommand Sync Services Ado.Net

Hi, I want to use the DBServerSyncProvider's SelectClientIdCommand but i don't wan't to add more tables to my data base, i want to specifically define the clients id (as a long), something like this: long ClientIdentifier=540; SqlCommand ClientIdComm = new SqlCommand(); ClientIdComm.CommandType = CommandType.Text; ClientIdComm.Command...

Sync My Documents folder, using Active Directory?

Hey I'm trying to set up a backup feature for the users in a Active Directory Domain. The wish is for the clients "my docuemnts" folder to sync to a folder on the file server. Is this doable using Active Directory only, or do one need any third party applications? If its doable, what steps is needed to set this up, on the server, and...

Is synchronization needed when manipulating different array(object array) indices.

In the context if Java, I have a code like this, MyObject[] array; and in different threads i have a code like this array[i] = new MyObject(val); If I ensure that each of my threads use different values of "i" then would I need to synchronize the above statement to take care of race conditions? ...

What is a good strategy for caching prepared statements in Tomcat?

Hello, I am looking for a way to cache prepared statements in a servlet environment (specifically, Tomcat 5.5). This is meant to reduce the number of times that prepared statements are created, i.e. the number of times that connection.prepareStatement(sql) is called. My initial idea was to store PreparedStatement objects in the session...

SQL Compact To SQL Express Real-Time Merging/Syncing

I have an application that currently uses SQL Compact Edition as its database for capturing realtime data. Some of my users would like to write their own applications to query and report against this data while it's being captured by my application. However, SQL Compact edition runs in-process with my application and therefore does not...

Is there a synchronization class that guarantee FIFO order in C#?

What is it and how to use? I need that as I have a timer that inserts into DB every second, and I have a shared resource between timer handler and the main thread. I want to gurantee that if the timer handler takes more than one second in the insertion the waited threads should be executed in order. This is a sample code for my timer ha...

Using MS Synchronisation framework with J2EE webservices to provide offline .Net client application feature.

I use a glassfish server to expose (METRO / WSIT) webservices that handle entity database accesses. I would like to know if someone tryed to use MS Sync Framework with this configuration to enable offline .net client feature. Thanks for incoming anwsers. ...

Does anyone already used Mesh4x ?

In order to provide heterogeneous synchronization between devices, have you ever used Mesh4x ? It uses FeedSync to synchronize data. http://code.google.com/p/mesh4x/ ...

Keeping tables synchronized in Oracle

Hi, We're about to run side-by-side testing to compare a legacy system with a new shiny version. We have an Oracle database table, A, that stores data for the legacy system, and an equivalent table, B, that stores data for the new system, so for the duration of the test, the database is denormalized. (Also, the legacy system and table A...

Read/Write Locks

As part of a project at work, I implemented a Read/Write lock class in C++. Before pushing my code to production, what sort of tests should I run on my class to be sure it will function correctly. I've obviously performed some sanity tests on my class (making sure only one writer can access at a time, making sure releases and claims ...

Are Synchronized Methods Slower In Single Threaded Applications?

I've been debating this to myself for the last few minutes, and I'm seeing reasons for both yes and no. This stemmed from looking at the answers to Java HashMap vs. Hashtable and seeing several people say Hashtable is in fact slower. It seems to me that a synchronized method should act absolutely no different than its unsynchronized co...

Need help on choosing locks for thread synchronization

I have several modifying threads and some reading threads, which all access the global variable X. I want to make my synchronization policy like this: When a thread try to modify X, it will require a lock first, and several modifying threads can have several locks required. When a thread try to read X, it must wait until all the modify...

synchronized execution across machines

I have a C# ASP.NET web app running on two machines behind a load balancer. We use sticky sessions so we do not have a shared out of process session state. Our code makes use of a SQL database and we process credit cards. We need to synchronize execution of a block of code that checks conditions in the database and also attempts to ch...

jquery synchron fadeout and fadeto with differnt elements

Hello everyone, i try to get a solution for following problem. synchron fadeout and fadeTo with different elements. the page behavior should be like this - page load - content hidden - menu shown - content fadeIn and menu fadeTo opacity 0.0 my snippset of code $(document).ready(function(){ $(".content_main").hide(); $("....

Any reason NOT to slap the 'synchronized' keyword everywhere?

In my java project, almost every non-static method I've written is synchronized. I've decided to fix up some code today, by removing most of the synchronized keywords. Right there I created several threading issues that took quite a while to fix, with no increase in performance. In the end I reverted everything. I don't see anyone else ...

Critical sections with multicore processors

With a single-core processor, where all your threads are run from the one single CPU, the idea of implementing a critical section using an atomic test-and-set operation on some mutex (or semaphore or etc) in memory seems straightforward enough; because your processor is executing a test-and-set from one spot in your program, it necessari...