deadlock

Python embedding with threads -- avoiding deadlocks?

Is there any way to embed python, allow callbacks from python to C++, allowing the Pythhon code to spawn threads, and avoiding deadlocks? The problem is this: To call into Python, I need to hold the GIL. Typically, I do this by getting the main thread state when I first create the interpreter, and then using PyEval_RestoreThread() to ...

When is it appropriate to use NOLOCK?

I am having timeout issues and deadlocks from time to time with some long running queries. I'm wondering when is it most appropriate to use NOLOCK and where? Do I use it on the updates & inserts? or reads? ...

SQLServer deadlock

Hi, I have a java application which is doing multiple concurrent CRUD operations on a database. I'm adding support for SQLServer but am having problems with deadlocking during concurrent deletes. After some investigation it appeared that the problem may be due to lock escalation on a particular table. In an attempt to fix it, I decide...

Is it possible to create a deadlock with read-only access?

I have a VB6 application accessing a single table on a MSSQL2000 server via ADO. I'm using read-only access (adOpenStatic, adLockReadOnly) There are other applications in the network which do make changes to the table. For some reason I'm getting errors about my application being chosen as a deadlock victim. I'm really confused: Why c...

Oracle deadlock detection tool

I am looking for a static analyser of Oracle queries and PL/SQL procedures (triggers, constrains, ...) - a tool that will pass on our DB scheme and point to potential deadlocks. Just like FindBugs for Java. If such a tool does not exist, would you like to have it ? ...

j2me networking, threads and deadlocks

The simple piece of midlet code (class Moo) below (after the excerpts) deadlocks (At least I assume it deadlocks after reading this post on threads here). I have reproduced the relevant excerpts from the post : String url = ... Connection conn = null; try { conn = Connector.open( url ); // do something here ...

Can DCOM/ COM+ activated objects deadlock CPU?

How does one figure out CPU level deadlocks for a COM+ application? This is an application running on Win2K. Regardless of the load, 1 object which is used by all other objects starts building up call times suddenly and then the system crashes. The only way to restore the system to its normal working situation is by restarting the COM+ a...

Sample code to illustrate a deadlock by using lock(this)

I've read several articles and posts that say that lock(this), lock(typeof(MyType)), lock("a string") are all bad practice because another thread could lock on the same key and cause a deadlock. In order to understand this problem, I was trying to create some sample code to illustrate the deadlock but have been unable to wrap my head ar...

How to see SQL 2008 Locks and Blocked Tables

Hi. During the ASP.NET execution of my app, it seems SQL 2008 Express holds some lock, and I get Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding Maybe some of my query is not optimized. Visual Studio crashes with: Microsoft Visual Studio may be unstable now. ...

SQL Server 2000 Deadlock

We are experiencing some very annoying deadlock situations in a production SQL Server 2000 database. The main setup is the following: SQL Server 2000 Enterprise Edition. Server is coded in C++ using ATL OLE Database. All database objects are being accessed trough stored procedures. All UPDATE/INSERT stored procedures wrap their intern...

Why doesn't anyone care about this MySQLdb bug? is it a bug?

TL;DR: I've supplied a patch for a bug I found and I've got 0 feedback on it. I'm wondering if it's a bug at all. This is not a rant. Please read this and if you may be affected by it check the fix. I have found and reported this MySQLdb bug some weeks ago (edit: 6 weeks ago), sent a patch, posted it on a couple of ORM's forums, mailed ...

Problem with deadlock on SELECT/UPDATE

Hi. I'm having a problem with deadlock on SELECT/UPDATE on SQL Server 2008. I read answers from this thread: http://stackoverflow.com/questions/661908/sql-server-deadlocks-between-select-update-or-multiple-selects but I still don't understand why I get deadlock. I have recreated the situation in the following testcase. I have a table:...

Advice for minimizing locking on an append only table in MS SQL Server?

I'm writing some logging/auditing code that will be running in production (not just when errors are thrown or while developing). After reading Coding Horror's experiences with dead-locking and logging, I decided I should seek advice. (Jeff's solution of "not logging" won't work for me, this is legally mandated security auditing) Is the...

Why does the following SQL Server insert deadlock when run within a transaction?

I'm currently inserting a record into a SQL Server Table and then selecting the auto-increment ID as follows: (@p0 int,@p1 nvarchar(8))INSERT INTO [dbo].[Tag]([Some_Int], [Tag]) VALUES (@p0, @p1) SELECT CONVERT(Int,SCOPE_IDENTITY()) AS [value] (This was generated using Linq-to-SQL). For some reason when I run this code inside a trans...

SQL server 2005 deadlock situation

What are the possible situations which make deadlock happen on SQL server? How to solve with that situation? ...

Debugging deadlocking threads in a MT program?

What are the possible ways to debug deadlocking threads in a MT program, other than gdb? ...

Avoid deadlocks in a multithreaded process

What are the best practices/idioms should someone follow in order to avoid deadlocks? ...

Critical section negative lock count

I am debugging a deadlock issue and call stack shows that threads are waiting on some events. Code is using critical section as synchronization primitive I think there is some issue here. Also the debugger is pointing to a critical section that is owned by some other thread,but lock count is -2. As per my understanding lock count>0 mea...

thread is stuck while registering channel with selector in Java NIO server.

I have a basic question. Why and how SelectableChannel's register method can be in blocking call. Let me provide a scenario. I have created a Selector object in class Register as follows. private static Selector selector = Selector.open(); I also have a method in same class(Register) to register the channel with the selector. ...

Deadlock when closing thread

I created a class that opens a COM port and handles overlapped read and write operations. It contains two independent threads - one that reads and one that writes data. Both of them call OnXXX procedures (eg OnRead or OnWrite) notifying about finished read or write operation. The following is a short example of the idea how the threads...