synchronization

With MS Sync Framework 2.0, how can I best handle related tables?

Sync Framework synchronizes data on a table-by-table basis, but my entities are normalized across sets of related parent-child tables. This creates problems for my application where a parent row might appear on the server to be processed, but the child rows might not appear for a few seconds. If there is a connection problem between my c...

Example of 'volatile' preventing a compiler optimization in C#?

From what I understand, the 'volatile' modifier in C# has two effects: Inserts fences as necessary for the target processor Prevents certain compiler optimizations On x86 / amd64, (1) is irrelevant. Those processors don't require fences for volatile semantics. (ia64 is different, though.) So, we are down to (2). But, for examples th...

.NET: Mechanism for sync-ing long-running tasks

Problem description: you write a library which contains some algorithms/tasks which can take a long time to finish, for various reasons: computational, file system, network communication etc. You want to be able to: Send some progress information about the task (progress, activity logging etc.) Have a way to abort the task before comp...

What is a good way to sync code files between computer?

I have a need to code from two computers during the week. What is the best way to sync the two computers (mac)? I've started using source control, like SVN. It works pretty good, except sometimes I check in code that I want to sync but they don't compile and it interferes with other people on the team working on the same project. I don...

How do I synchronize (lock/unlock) access to a file in bash from multiple scripts?

I'm writing scripts that will run in parallel and will get their input data from the same file. These scripts will open the input file, read the first line, store it for further treatment and finally erase this read line from the input file. Now the problem is that multiple scripts accessing the file can lead to the situation where two...

Acceptable to lock (AppDomain.CurrentDomain)?

I want to enumerate all loaded assemblies in an Asp.NET application, using AppDomain.CurrentDomain.GetAssemblies(). However, when checking the documentation for AppDomain, I find the following statement: Thread Safety Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not gu...

Multithreaded Java Program for Conway's game of life - contention at the border cells

I am learning concurrent programming in java, and writing a simulation for Game of Life. Here is what I am thinking: Use int[][] to store the states of the cells partition the int[][] into t segments and use t worker threads The t threads will read from their segment, calculate new values for all the cells in their segment and update ...

Manipulating ObservableCollection vs Replacing a List

I have a backend Dictionary that is used for synchronization (ie. to both a filestore and a webservice). Off the top of this I need to generate lists/enumerables for the WPF frontend to consume. What is the difference between either hooking an enumerable up to the dictionary, and calling PropertyChanged when it is updated to using an Ob...

Java: what happens when a new Thread is started from a synchronized block?

First question here: it is a very short yet fundamental thing in Java that I don't know... In the following case, is the run() method somehow executed with the lock that somemethod() did acquire? public synchronized void somemethod() { Thread t = new Thread( new Runnable() { void run() { ... <-- is a lock...

What does the Win32 CRITICAL_SECTION contain?

What data does the Win32 CRITICAL_SECTION contain, and how big is it? This is undocumented and presumably implementation specific, but I'm curious to know ...

Detached Smart Client Syncing

I am working on an application at the minute that will originally be just installed on a client machine with a lightweight database (may SqlLite). After a while I want to add a web version of the same piece of software and with this the smart client will then be able to sync with the online version. Has anyone done anything similar, ...

ORM with automatic client-server data syncronization. Are there any ready to use solutions?

Consider the client application that should store its data on remote server. We do not want it to access this data "on-fly", but rather want it to have a copy of this data in local database. So we do not need connection with remote server to use application. Eventually we want to sync local database with remote server. The good example o...

Synchronizing Core Data data with External Database

I have started working on an iPhone application that where I need to synchronize data with an external MySQL database. The current database scheme uses GUID/UUID fields as primary keys to maintain relationships between tables. I already have this working between a database app and the MySQL database, so this isn't a question regarding sy...

Automatically Creating Client Schema with Microsoft Sync Framework

I need to make a local copy of a database in a .NET app so that it can function offline. My server database is SQL Server 2005, and it's copying to SQL Server 2008 Express. It doesn't have to be anything fancy - just start from scratch (or delete the existing db), copy all tables/constraints/foreign keys, and copy data from some of the...

Microsoft Sync Framework with Mutliple Client and Server Database

I'm working on changes to an application to have a local data store instead of connecting directly to the database server. The client app will then sync changes both ways between the server database and its local data store. I'm trying to implement the syncing solution using Microsoft Sync Framework. To be clear there is no server applic...

How is thread synchronization implemented, at the assembly language level?

While I'm familiar with concurrent programming concepts such as mutexes and semaphores, I have never understood how they are implemented at the assembly language level. I imagine there being a set of memory "flags" saying: lock A is held by thread 1 lock B is held by thread 3 lock C is not held by any thread etc But how is access to...

MySQL synchronization questions

I have a MySQL DB which manages users’ accounts data. Each user can only query he’s own data. I have a script that on initial login gets the user data and inserts it to the DB. I scheduled a cron process which updates all users’ data every 4 hours. Here are my questions regarding it: (1) - Do I need to implement some kind of lock mecha...

synchronous Vs asynchronous ruminations

Hey, Lets say I have my netwrok thread , which inside it I get Data regarding some people,and each record(of 1 man) is being put inside a queue. I have another Calcthread who reads from that queue and performs some calculation and DB actions. Since the calculation and DB actions take quite amount of time, I though doing the calculation...

Synchronizing one or more databases with a master database - Foreign keys

I'm using Google Gears to be able to use an application offline (I know Gears is deprecated). The problem I am facing is the synchronization with the database on the server. The specific problem is the primary keys or more exactly, the foreign keys. When sending the information to the server, I could easily ignore the primary keys, and ...

ReleaseSemaphore does not release the semaphore

(In short: main()'s WaitForSingleObject hangs in the program below). I'm trying to write a piece of code that dispatches threads and waits for them to finish before it resumes. Instead of creating the threads every time, which is costly, I put them to sleep. The main thread creates X threads in CREATE_SUSPENDED state. The synch is done...