synchronization

GWT and notifyAll() (java.lang.Object)

I'm making a call to the database. The result must be used for a subit form. So i want to wait until the result from the DB comes. For that i need a synchronization. My idea was to use the Object.notifyAll() from java.lang, but GWT doesn't support this. Is there any equivalent method in GWT for the notifyAll()? edit1: I'm using gxt Form...

Rsync operations

Hi, I'm trying to figure out how if rsyncing files is atomic. I couldn't find any confirmation about it. Due to rsync being able to send only deltas, I was under the impression that it also updates only parts of the live files. On the other hang DJB recommends rsync for synchronising live .cdb files and I've found this post ( http://lis...

Futex based locking mechanism

Hello, Somebody can tell me an example of using locking mechanism based on futex? (for muticore x86 CPU, CentOS) Thanks Dima ...

Synchronizing a service with a timer

I'm trying to write a service in c# that should be run on a given interval (a timeout) from a given date. If the date is in the future the service should wait to start until the date time is reached. Example: If I set a timeout to be 1 hour from 21:00:00 I want the program to run every hour If I set a timeout to be 1 hour from 3999....

No mapping exists from DbType System.DateTimeOffset to a known SqlCeType.

I have a SQL Server 2008 database that contains DateTimeOffset objects. As per this page, SQL Server Compact provides support for replicating the new data types in SQL Server 2008 such as date, time, datetime2, datetimeoffset, geography, and geometry. The new data types in SQL Server 2008 are mapped to nchar, nvarchar, image, etc. F...

Please explain History Monoid in Simpler Terms.

I tried to read the History monoid but couldn't wrap my head around it. Could somebody please explain it in simpler terms? Thank you Reference: http://en.wikipedia.org/wiki/History_monoid ...

does Monitor.Wait Needs synchronization?

Hi, I have developed a generic producer-consumer queue which pulses by Monitor in the following way: the enqueue : public void EnqueueTask(T task) { _workerQueue.Enqueue(task); Monitor.Pulse(_locker); } the dequeue: private T Dequeue() { T dequeueItem; if (_workerQueue.Count > 0) ...

Concurrent I/Os with same handle

Thread1 SetFileInformationByHandle(fileHandle, ...); Thread2 SetFileInformationByHandle(sameFileHandleWithThread1, ...); Thread1's function has been called first. and Thread2's function has been called in another thread. if the function's duration is 10 seconds -the device driver sleeps in the dispatch routine, will the se...

Is that synchro-construction correct ?

I have a multi-threaded application. Threads use ABC.Connector. I want that only one thread at a time have access to a Connector property. class ABC { /// <summary> /// Synchronization object. /// </summary> static object _syncObject = new object(); static DataAccess _connector; /// <summary> /// Global obje...

Lightest synchronization primitive for worker thread queue

I am about to implement a worker thread with work item queuing, and while I was thinking about the problem, I wanted to know if I'm doing the best thing. The thread in question will have to have some thread local data (preinitialized at construction) and will loop on work items until some condition will be met. pseudocode: volatile bo...

Strategies for calling synchronous service calls asynchronously in C#.

With business logic encapsulated behind synchronous service calls e.g.: interface IFooService { Foo GetFooById(int id); int SaveFoo(Foo foo); } What is the best way to extend/use these service calls in an asynchronous fashion? At present I've created a simple AsyncUtils class: public static class AsyncUtils { public stat...

how to create Synchronized arraylist

i have created synchronized arrayList like this import java.text.SimpleDateFormat; import java.util.*; class HelloThread { int i=1; List arrayList; public void go() { arrayList=Collections.synchronizedList(new ArrayList()); Thread thread1=new Thread(new Runnable() { public void run() { while(i<=10) { arrayList.ad...

COM + WaitForSingleObject

I've been trying to find a good architecture for one application for the last few days, and after some research I'm finally stuck, and the reason is COM. The app in question will have multiple GUI threads, and they will schedule work items for worker thread. The worker thread will initialize COM via CoInitialize(NULL);, create few COM c...

Waiting for Variable Change

Here my code snippet written in Qt. bool myFunc() { ....... while(!tcpCommunicator->isLoginReplyExist) { qApp->processEvents(QEventLoop::AllEvents); } ....... return tcpCommunicator->res; } After "isLoginReplyExist" is changed by another part of program I want to exit from loop, is there any better way to ...

Monitor Synchronization: Implementing multiple condition variables

I am implementing monitor synchronization. I was wondering how does implementing multiple condition variables works. So a condition variable has method wait() which puts it on the wait queue for a specific lock tied to this condition variable. So if I have multiple condition variables, do each wait call create its own separate wait queue...

7z file manager deletes temporary file for external editor

Hello! I am using a lot applications from portableapps.com for work, and more particularly 7-zip portable and gVim portable. I have set 7zip's external editor to gVimPortable.exe. It works perfectly when editing a file that is not inside an archive or compressed file… but it miserably fails when editing a file inside an archive or comp...

Synchronizing arbitrary properties in an object transparently in D

Let's say I have a class like so: class Gerbil{ int id; float x,y,z; } Let's further say this is part of a real-time simulation where I have a server/client setup and I change a property on the server-side: //... gerbil.x = 9.0; //... Now I want to send over this change to the client to synchronize the world state. However,...

What is the correct sequence in which cflock releases when using multiple locks in different functions?

Given the following scenario, I would like to know if functionOneLock releases itself before functionTwoLock is triggered, or does it wait until functionTwoLock releases first? <!--- functionOne() ---> <cffunction name="functionOne"> <cflock name="functionOneLock" type="exclusive"> <!--- do something ---> <cfset functionTwo()> </c...

synchronization in java

Will following 2 code block achieve the same result. What is the difference better then, if any? class test { Object obj = new Object(); void test(){ synchronized(obj){ } } void test1(){ synchronized(this){ } } } ...

Cannot put object on Queue

I want to put an instance of scapy.layers.dhcp.BOOTP on a multiprocessing.Queue. Every time I call put() the following exception occures: Traceback (most recent call last): File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed send(obj) PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.f...