Since thread execution happens in a pool, and is not guaranteed to queue in any particular order, then why would you ever create threads without the protection of synchronization and locks? In order to protect data attached to an object's state (what I understand to be the primary purpose of using threads), locking appears to be the only...
I just need a confirmation that i have understood the concept of locks in synchronized blocks correctly.
First I will tell what I have understood.
Acquiring a lock of an object means that no other thread can access the synchronized code of the object's class. In case of synchronized methods, Threads acquire lock on the object used to inv...
Hi, Im working with a MS Sync Framework 2.0 on my project. I am using MS SQL Server 2005 as the main DB and SQL CE 3.5 for the client DB. Everything's working fine except that the schema from the main db is not copied to the local db.
for example:
I have a table with a PK column with uniqueidentifier datatype and a NEWID() default value...
Using EJB entity beans you can configure the bean so that when a thread has access to an EJB entity bean, no other threads can access the EJB bean. The container will block other threads until the thread with the lock is finished with the bean. Is there a "Spring way" to do this? Or do you have to just use the standard Java concurrenc...
I might inherit a somewhat complex multithreaded application, which currently has several files with 2+k loc, lots of global variables accessed from everywhere and other practices that I would consider quite smelly.
Before I start adding new features with the current patterns, I'd like to try and see if I can make the basic architecture...
Hi,
I'm developping a distributed solution with a WebSite and a Corporate Application Management.
Here is the architecture :
Web Site :
Database (SQL Server)
Web Site : ASP.NET MVC
Data synchronization Services (WCF)
-
Corporate Management Application :
Database (SQL Server)
WinForm Application
Data...
is it thread safe to add elements to a Map by multiple threads at the same time ?
Like if 10 threads add an element to a Map at exactly the same time, is the Map going to have 10 elements or 1 ?
UPDATE: I don't need to iterate through this map, all I need is to add, remove and get elements by key
...
I have a WinForms app (c#) that has a background thread that periodically grabs data from a data source, does some manipulation of it, and puts it in a DataTable. There are 1 or more components in the app that periodically poll this common data to do stuff with it. I'm wondering, what's the "right" way to synchronize this, so e.g. the co...
I have a java applet. A class inside that applet is creating a thread to do some work, waiting 30 seconds for that work to complete, if its not completed in 30 secs it sets a Boolean to stop the thread. The wait and Boolean change are in a synchronized block, Is this necessary considering there is no other thread running aside from these...
Hello,
I have a desktop client that is using the sync framework to synchronise the database to the server. I am experiencing problems occasionally with it "Cleaning up" the tables change tracking.
I did some research and found a post on the internet that gave some code that resets the anchors on the table and then resynchronises. This ...
As the title says, what are the compiler, CLR or CPU optimizations to be aware of when working with threads and non-blocking synchronization?
I have read a little about the reordering of instructions to improve efficiency that could break things, and caching optimizations that will result in variables not being visible to other threads ...
Ok so here is the scenario. We have two developers using the
developer edition of Mobilink to sync to a consolidated Oracle
DataBase using SqlAnywhere.
The mobilink Version is Version 11.0.1.2331
Everything works fine in the two development environments.
One dev environment is Windows 7 x64 and Oracle 11g r1. The other is xp x86
...
The title sounds like there is a lot of problems ahead. Here's my specific case:
This is a travel tickets sales system. Each route has a limited quantity of tickets, and so purchasing the last ticket for a given route shouldn't be accessible to two people (a standard scenario). However, there is the "return ticket" option.. So, I'm usin...
Is there a C# equivalent to Java's CountDownLatch?
...
The press release of Android 2.0 states that the new release supports sync adapters so that emails and calendars cannot only be synced with gmail and exchange. However, there is no information available online how to write such a sync adapter. Has anyone tried it and some example code available?
...
I'm looking for a fast and efficient implementation of a Semaphore for the .NET Compact Framework. There has been another Question here on SO (Semaphores in .NET compact framework) in which it was suggested to use P/Invoke, but this is not possible in the XNA Framework running on the XBox 360.
I can offer two implementations of my own, ...
Hi,
I have a database in MySQL and another database that runs on MS SQL.
The MySQL is the backend database for my website running on Joomla.
I have an ERP running my store. This ERP is made by a 3rd party in .Net
A table called the orders gets updated whenever a user places an order in my website.
The order details must get flushed to ...
Is the SQL Server synchronized to be compatible with many processes? Do i have to make synchronization to be possible to work with DataBases so that more than 1 process be used at the same time?
...
Hello,
I have a Dictionary<> collection that contains characters. The collection has items added and removed constantly by multiple threads. Would initializing a new List<> collection using the dictionary need a lock?
Example code:
List<Character> charsToUpdate = new List<Character>(this.manager.characters.Values);
Thanks in advance...
I have an XML data source, which I'm loading / refreshing.
I'm populating a data model from this source and would like to manage synchronisation issues
e.g. being able to notify the GUI/User when items have been removed, had their values increased / decreased, changed... etc.
I'm wondering if there is a standard way of doing this?
I...