deadlock

EnterCriticalSection Deadlock

拟墨画扇 提交于 2019-12-06 06:45:27
问题 Having what appears to be a dead-lock situation with a multi-threaded logging application. Little background: My main application has 4-6 threads running. The main thread responsible for monitoring health of various things I'm doing, updating GUIs, etc... Then I have a transmit thread and a receive thread. The transmit and receive threads talk to physical hardware. I sometimes need to debug the data that the transmit and receive threads are seeing; i.e. print to a console without interrupting

Why does this code deadlock?

╄→гoц情女王★ 提交于 2019-12-06 06:24:22
问题 I created 2 Linux kernel threads in my loadable module and I bind them to separate CPU cores running on a dual core Android device. After I run this few times, I noticed that the device reboots with a HW watchdog timer reset. I hit the issue consistently. What could be causing the deadlock? Basically, what i need to do is, make sure both the threads run do_something() at the same time on different cores without anybody stealing the cpu cycles(i.e. interrupts are disabled). I am using a

dispatch_barrier_sync always deadlocks

痴心易碎 提交于 2019-12-06 06:23:56
问题 Given the following snippet of code: #import <XCTest/XCTest.h> @interface DispatchTests : XCTestCase { dispatch_queue_t _workQueue; dispatch_queue_t _readWriteQueue; int _value; } -(void)read; -(void)write; @end @implementation DispatchTests -(void)testDispatch { _workQueue = dispatch_queue_create("com.work", DISPATCH_QUEUE_CONCURRENT); _readWriteQueue = dispatch_queue_create("com.readwrite", DISPATCH_QUEUE_CONCURRENT); _value = 0; for(int i = 0; i < 100; i++) { dispatch_async(_workQueue, ^{

How to get rid of deadlock in a SQL Server 2005 and C# application?

风格不统一 提交于 2019-12-06 06:14:05
问题 I have a code in C# for windows service which is mainly responsible to update records in a table in my database, but I get always a lot of errors in my log, all errors are about deadlock of resource, This is the error: System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 57) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean

SQL deadlock on delete then bulk insert

╄→гoц情女王★ 提交于 2019-12-06 05:47:28
问题 I have an issue with a deadlock in SQL Server that I haven't been able to resolve. Basically I have a large number of concurrent connections (from many machines) that are executing transactions where they first delete a range of entries and then re-insert entries within the same range with a bulk insert. Essentially, the transaction looks like this BEGIN TRANSACTION T1 DELETE FROM [TableName] WITH( XLOCK HOLDLOCK ) WHERE [Id]=@Id AND [SubId]=@SubId INSERT BULK [TableName] ( [Id] Int , [SubId]

How to check possibility of deadlock in c# code

人盡茶涼 提交于 2019-12-06 05:33:02
问题 My application sometimes stop in the below code, not always but sometimes. All the 3 methods CalcQuarterlyFigures , CalcWeeklyFigures & CalcMonthlyFigures return Task<List<MyClass>> . Note, this runs inside a foreach loop. List<Task> TaskList = new List<Task>(); if(i.DoCalculateAllHistory) { var quarterly = CalcQuarterlyFigures(QuarterlyPrices, i.SeriesID); TaskList.Add(quarterly); var weekly = CalcWeeklyFigures(WeeklyPrices, i.SeriesID); TaskList.Add(weekly); var monthly = CalcMonthlyFigures

Postgres deadlocks on concurrent upserts

倾然丶 夕夏残阳落幕 提交于 2019-12-06 05:19:28
问题 We have an application which reads from a data stream and upserts that information into a database. The data is changes which occur on Google Drive which means that many events which impact the same objects can occur very close to each other. We're running into deadlocks when upserting this information into the database, here is what comes out in the log. I have reconstructed and sanitised the query for readability: ERROR: deadlock detected DETAIL: Process 10586 waits for ShareLock on

Acquiring multiple locks atomically in java

空扰寡人 提交于 2019-12-06 05:06:31
问题 I have the following code: Note: I simplified the code as much as possible for readability. If I forgot any critical pieces let me know. public class User(){ private Relations relations; public User(){ relations = new Relations(this); } public getRelations(){ return relations; } } public class Relations(){ private User user; public Relations(User user){ this.user = user; } public synchronized void setRelation(User user2){ Relations relations2 = user2.getRelations(); synchronized(relations2){

postgresql deadlock

纵饮孤独 提交于 2019-12-06 03:44:35
问题 Sometimes postgresql raise error deadlocks. In trigger for table setted FOR UPDATE. Table comment: http://pastebin.com/L1a8dbn4 Log (INSERT sentences is cutted): 2012-01-26 17:21:06 MSK ERROR: deadlock detected 2012-01-26 17:21:06 MSK DETAIL: Process 2754 waits for ExclusiveLock on tuple (40224,15) of relation 735493 of database 734745; blocked by process 2053. Process 2053 waits for ShareLock on transaction 25162240; blocked by process 2754. Process 2754: INSERT INTO comment (user_id,

Deadlock with ContinueWiths in WebAPI

坚强是说给别人听的谎言 提交于 2019-12-06 03:43:00
问题 We've been running into a lot of deadlocks as part of exposing some of existing code over Web API. I've been able to distill the problem down to this very simple example that will hang forever: public class MyController : ApiController { public Task Get() { var context = TaskScheduler.FromCurrentSynchronizationContext(); return Task.FromResult(1) .ContinueWith(_ => { }, context) .ContinueWith(_ => Ok(DateTime.Now.ToLongTimeString()), context); } } To me, that code seems simple enough. This