What's the best way to implement a Hash that can be modified across multiple threads, but with the smallest number of locks. For the purposes of this question, you can assume that the Hash will be read-heavy. It must be thread-safe in all Ruby implementations, including ones that operate in a truly simultaneous fashion, such as JRuby, an...
I've just written a method that is called by multiple threads simultaneously and I need to keep track of when all the threads have completed, the code uses this pattern:
private void RunReport()
{
_reportsRunning++;
try
{
//code to run the report
}
finally
{
_reportsRunning--;
}
}
This is the only p...
Is there a way to know if a table is locked and what kind of lock is currently on a table? I was hoping for something through the DBC tables in teradata, but I can't find any reference to anything like this. I have normal user access and the DBA is no help. Thanks.
...
I'm using Visual Studio 2008 and developing a VB.NET application.
I'm having strange lockup problems with my program, but only when Internet explorer 8 is opened.
When I cover my form with another window and then uncover it, I find that it has locked up.
My program has no references to IE and the only thing it even has to do with IE is ...
How would I make it so you cant drag outside of the UK in google maps?
Can you lock it down to a certain area, as I'd like to be able to drag around the UK but not outside.
Ta
Chris
...
I am trying to rotate out an innoDB table which has a high number of transaction, so I need to lock all the tables involved.
With the tables locked I cannot use RENAME to move data around using auxiliary tables.
And if I do an INSERT, then I have to worry about the integrity of the ids.
Any suggestions? Is this even possible
...
I am having an argument with a developer colleague on the team.
Problem: SQL query X runs for 1 second on the test system, but for an unknown amount of time on live system (150 users can run queries at the same time).
The query causes locks on 8 tables, of which 7 are useless.
His idea is to put a WITH (NOLOCK) on the 7 tables so there ...
In manual it said that InnoDB has row-level locking, so why if I select some of the rows with FOR UPDATE statement it won't let me insert new row into that table? New row shouldn't be locked after all, it wasn't selected.
...
A bit of help please, consider the bit of code below.
public class Widget {
public synchronized void doSomething() {
...
}
}
public class LoggingWidget extends Widget {
public synchronized void doSomething() {
System.out.println(toString() + ": calling doSomething");
super.doSomething();
}
}
I ...
With a pthread_cond_t we have to associate a mutex, When signalling the condition I've seen code such as
pthread_mutex_lock(&mutex);
//code that makes condition true
pthread_cond_broadcast(&cond);
pthread_mutex_unlock(&mutex);
and
pthread_mutex_lock(&mutex);
//code that makes condition true
pthread_mutex_unlock(&mutex);
pthread_...
Hello everyone,
For the same ADO.Net statement, I want to make sure my understanding of isolation level and lock is correct.
In default SQL Server isolation level (read committed), after read each row, the row will unlocked;
If I raise isolation level to repeatable read, the lock (on the whole table? or some other level lock?) will be...
I have mounted a cifs file on two Linux machines. I have a Perl script which can modify the shared file. How do we lock the file over network in this scenario?
...
let info = new SortedDictionary<string, string>
...
Thread A
--------
info.Add("abc", "def")
Thread B
--------
info
|> Seq.iteri (fun i value -> ...
Where do I place the readLock when I use the iteri function?
...
Hi Guys,
It is mentioned that one of the advantages of Lock (java.util.concurrent.locks.Lock) over intrinsic lock is that Lock facilitates "chain locking". Chain locking being, hold a lock for A, then acquire B, after acquiring B release A and then acquire C ...
I am just curious, have you guys encountered any situation in which the u...
I'm using asp.net c# and upload a SqLite database to a server and then I do some inserting and updating. The problem is that sometimes (I think it's when somethings go wrong with the updating or so) the database gets locked. So the next time I try to upload a file again it's locked and I get an error saying "The process cannot access the...
My visual studio solution includes a web application and a unit test application. My web application uses log4net. I want to be able to use msbuild from the command-line to build my solution. However, whenever I build the solution from the command-line, I get build errors because it can't copy log4net.xml to the test project's bin direct...
I am testing the fault tolerance of an ActiveMQ system configured as JDBC Master/Slave. In this setup there is one postgres database and two brokers--one is the master broker, the other is a slave broker. The way this mechanism works is the master takes out an exclusive lock on a table in the db. The slave tries to do this also and waits...
I have a class with code as follows
private readonly object m_lock = new object();
private IClient m_client
private object m_context;
When setting the client and context, I lock as follows
lock(m_lock)
{
m_client = theClientFromSomewhere;
m_context = contextObject;
}
My question is, if I only need to get the m_client by it...
How can I do the lock profiling (spin and other kind of locks) in 2.6 Linux kernel? I want to get the lock contention numbers for few locks which I have added in my module. Is there any .config option which I can enable and get the profile or any other tool?
...
hi guys, i'm having some really strange problem.
i wrote a filemanager in PHP with the ability to download files -- which works fine.
the whole script is built as one big file.
now, while downloading a big file i'm not able to use the script at the same time for, say, browsing folder contents. it does nothing but keep loading. as soon ...