Hi.
I recently started this question in another thread (to which Reed Copsey
graciously responded) but I don't feel I framed the question well.
At the core of my question, I would like an illustration of how to gain
access to data AS it is being get/set.
I have Page.aspx.cs and, in the codebehind, I have a loop:
List<Ser...
In my project I need an application lock (same as windows lock). If the application is idle for a time period the application should be locked i.e, the login window for the application will appear. How can I do it in a WPF C# application?
...
Is there a way to unlock a file on Windows with a Python script? The file is exclusively locked by another process. I need a solution without killing or interupting the locking process.
I already had a look at portalocker, a portable locking implementation. But this needs a file handle to unlock, which I can not get, as the file is alre...
I'm currently writing a library that can be used to show the internal state of some running code (mainly fields and properties both public and private). Objects are accessed in a different thread to put their info into a window for the user to see. The problem is, there are times while I'm walking a long IList in which its structure may ...
Why may this happen? The thing is that monitor object is not null for sure, but still we get this exception quite often:
java.lang.IllegalMonitorStateException: (m=null) Failed to get monitor for (tIdx=60)
at java.lang.Object.wait(Object.java:474)
at ...
The code that provokes this is a simple pool solution:
publi...
I have a class used to cache access to a database resource. It looks something like this:
//gets registered as a singleton
class DataCacher<T>
{
IDictionary<string, T> items = GetDataFromDb();
//Get is called all the time from zillions of threads
internal T Get(string key)
{
return items[key];
}
IDicti...
One of our clients is using some Novel security software that sometimes locks some .class files that our software creates. This causes some nasty problems for them when this occurs and I am trying to research a workaround that we could add to our error handling to address this problem when it comes up. I am wondering are there any call...
[EDIT NOTE: Noticed I had put the mutex creation in the constructor. Moved it and noticed no change.]
[EDIT NOTE 2: I changed the call to app.exec in a trial run to
while TRUE do
app.processEvents()
puts '."
end
I noticed that once the Soap4r service started running no process events ever got called again]
[EDIT NOTE 3: Cr...
hi, i am new to c# and multithreading. please help me how to write a c# program to implement a stack of integers using join and lock statements...
...
I have a base class, Token. It has no implementation and as such acts as a marker interface. This is the type that will be used by callers.
{
Token t = startJob(jobId);
// ... (tasks)
// t falls out of scope, destructors are called
}
I have a derived class, LockToken. It wraps around a mutex and insures the lock is acquire...
My question refers to whether or not the use of a ReentrantLock guarantees visibility of a field in the same respect that the synchronized keyword provides.
For example, in the following class A, the field sharedData does not need to be declared volatile as the synchronized keyword is used.
class A
{
private double sharedData;
p...
Is there a way that one can test if a row has been locked for update in Oracle?
As an example, suppose the following query, performed by one user:
select * from SOME_TABLE where THE_ID = 1000 for update;
With another user I want to check if the row with THE_ID = 1000 is locked. If I try an update or something the second user gets blo...
I am trying to figure out how to read/write lock a CSV or XLS file when I read it as a Database via Jet OLEDB.
The following code will open a CSV as a DB and load it into a DataTable object:
private DataTable OpenCSVasDB(string fullFileName)
{
string file = Path.GetFileName(fullFileName);
string di...
I noticed that 'show processlist' on our MySQL server indicates a lot of threads in 'System lock' state, often followed by just 'Locked', the latter which I'd expect since we have some selects locking behind an update/insert on a MyISAM table.
But 'System lock' shows up a lot more than just 'Locked' (sometimes adding up to 2 seconds to ...
I have a database table where I need to pull a row, test user input for a match, then update the row to identify the user that made the match. Should a race condition occur, I need to ensure that the first user's update is not overwritten by another user.
To accomplish this I intend to:
1. Read row
2. Lock table
3. Read row again and c...
Should I make a single NSLock instance in the application delegate, to be used by all classes? Or is it advisable to have each class instantiate its own NSLock instance as needed?
Would the locking work in the second case, if I, for example, had access to a managed object context that is spread across two view controllers?
...
x86 and other architectures provide special atomic instructions (lock, cmpxchg, etc.) that allow you to write 'lock free' data structures. But as more and more cores are added, it seems as though the work these instructions will actually have to do behind the scenes will grow (at least to maintain cache coherency?). If an atomic add take...
From the Wikipedia article on Read-Copy-Update:
The reason that it is safe to run the removal phase concurrently with readers is the semantics of modern CPUs guarantee that readers will see either the old or the new version of the data structure rather than a partially updated reference.
Is this true for all modern CPUs (ARM, x86, ...
I'm writing something to handle concurrent read/write requests to a database file.
ReentrantReadWriteLock looks like a good match. If all threads access a shared RandomAccessFile object, do I need to worry about the file pointer with concurrent readers? Consider this example:
import java.io.FileNotFoundException;
import java.io.IOExc...
Hi,
We have more than 1 instances of a certain exe running from different locations. An exe is supposed to fetch a set of records and do some work based on them. The set of records fetched from exe A should not be fetched by exe B and vice versa. Exes A & B are the same exes; they are running from different locations. The number of inst...