Questions tagged [synclock]

SyncLock is the VB.NET keyword for its locking statement.

SyncLock is the VB.NET keyword for its locking statement, allowing any non-structure type to be locked by a transaction.

46 questions
2
votes
1 answer

Synclock a section of code while waiting for ShowDialog to return

I'm having trouble working out how to lock my application out of a section of code while it waits for a response from an external program I've used Synclock on a section of code with the Me object in the expression. In this Synclock I call an…
chris.au
  • 1,088
  • 2
  • 15
  • 41
2
votes
2 answers

jQuery Ajax SyncLock

I have a couple of buttons that users can click to load content with jQuery's $.ajax. All the buttons load the content into the same div tag. The problem is that if users click multiple times quickly, the content can flash several times before…
Paul Knopf
  • 9,568
  • 23
  • 77
  • 142
2
votes
0 answers

Access denied when using SyncLock/lock

This error is not common and I have so far found this on one computer only. It can be reproduced but I do not have the develop environment on that computer. The error appears when calling SyncLock/lock on an object. What could create this kind of…
serializer
  • 1,003
  • 2
  • 13
  • 27
2
votes
1 answer

SyncLock and very many threads VB .Net

My case is I have the following method that uses SyncLock to ensure the writing of file by one thread at a time. Private Shared lockThis As New Object Public Sub Process() SyncLock lockThis File.AppendAllText("c:\jamo\foo.txt","foo") End…
Jamo
  • 494
  • 5
  • 24
2
votes
2 answers

SyncLock on List in Multithread still throws ArgumentException

I need to read from a list on a (background) thread while it may be updated from another (main thread). So I try to just make a temporary list not to access the original object. As updates may occur on multiple places, it would be convenient to…
bretddog
  • 5,411
  • 11
  • 63
  • 111
2
votes
4 answers

VB.net SyncLock Object

I always seen on SyncLock examples people using Private Lock1 As New Object ' declaration SyncLock Lock1 ' usage but why? In my specific case I'm locking a Queue to avoid problems on mult-threading Enqueueing and Dequeueing my data. Can I…
Budius
  • 39,391
  • 16
  • 102
  • 144
2
votes
1 answer

How to SyncLock a Shared Integer

I am pretty new to multi-threading in general and I would like to know how can I lock a shared integer variable to not be accessed by other threads while it is read/updated by an other thread. When I try do do SyncLock myInteger, I get that error :…
MaxiWheat
  • 6,133
  • 6
  • 47
  • 76
1
vote
1 answer

Is there any way to synchronise the clock of my avd

I am using android virtual device for android developing and i am developing an app to update status in twitter and seeing the logcat i think the problem is that it's system clock is not synchronised can anyone please help. Logcat 12-06…
sayem siam
  • 1,281
  • 3
  • 13
  • 26
1
vote
1 answer

asp.net multithreading with synclock

i have some test code which i run at every load of a page in my asp.net website this is the code Sub TryThreads() Dim t1 = New Thread(AddressOf TryLock) t1.Priority = ThreadPriority.Lowest t1.Start() Dim t2 = New Thread(AddressOf…
Yisroel M. Olewski
  • 1,560
  • 3
  • 25
  • 41
1
vote
1 answer

Using SyncLock to synchronize access to List(of T)

I have a class that contains a List(of T) used in a multithreaded application. I have three methods Get, Add and Remove where these access and modify the List(of T). I was using SyncLock to lock m_List any time I queried it for the desired object…
Achilles
  • 11,165
  • 9
  • 62
  • 113
1
vote
1 answer

.NET SyncLock order deadlock

If I have two Synclocks synclock a synclock b end synclock end synclock am I in danger of a deadlock if I never have synclock b synclock a end synclock end synclock in my code, but I do synclock on a or b randomly?
Hamm Tia
  • 11
  • 1
1
vote
2 answers

Overzealous null checking of backing field in my singleton?

The code below represents a singleton that I use in my application. Lets assume that _MyObject = New Object represents a very expensive database call that I do not want to make more than once under any circumstance. To ensure that this doesn't…
oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
1
vote
2 answers

Incrementing Seven Segment by Using Push Buttons

My fpga is spartan 3E-100 Cp132. I have four push buttons as my inputs and I want to increment the four digits on 7-segment of the board by using them. The VHDL code is below: entity main is port(b1,b2,b3,b4 : in STD_LOGIC; clk …
user3100463
  • 15
  • 2
  • 4
1
vote
1 answer

Synclock List or ListItem

MS reference: http://msdn.microsoft.com/en-us/library/3a86s51t(v=vs.71).aspx "The type of the expression in a SyncLock statement must be a reference type, such as a class, a module, an interface, array or delegate." Scenario: Multiple threads…
Data
  • 23
  • 3
0
votes
2 answers

How to optimally implement locking that queues access to specific part of data?

My ASP.NET application provides access to various chunks of data. Each chunk can be accessed by one or more users simultaneously, so the app must prevent conflicts. After a lot of consideration, I'm thinking that optimistic concurrency is not the…
SharpAffair
  • 5,558
  • 13
  • 78
  • 158