Hey,
I have about 5 Shared variables, that I want to be locked for access when
they are written to.
I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's
what I'm looking for,
But the SycLock statement requires a statement in it's decleration:
SyncLock <Statement>
MySharedMember=NewValue
End SyncLock
What the statement's supposed to be?
Thanks ahead
-- Ram 3 2639
Hi,
Synclock MyVariableName
End Synclock
Or
SyncLock gettype(MyClass)
End Synclock.
Ken
-----------------------
"Ram" <ni***@bezeqint.net> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl: Hey, I have about 5 Shared variables, that I want to be locked for access when
they are written to. I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's what I'm looking for, But the SycLock statement requires a statement in it's decleration: SyncLock <Statement> MySharedMember=NewValue End SyncLock What the statement's supposed to be? Thanks ahead
-- Ram
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus ( http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004
Thanks alot!
--Ram
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:O6**************@TK2MSFTNGP11.phx.gbl... Hi,
Synclock MyVariableName
End Synclock
Or
SyncLock gettype(MyClass)
End Synclock.
Ken -----------------------
"Ram" <ni***@bezeqint.net> wrote in message news:ux**************@TK2MSFTNGP12.phx.gbl: Hey, I have about 5 Shared variables, that I want to be locked for access
when they are written to. I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's what I'm looking for, But the SycLock statement requires a statement in it's decleration: SyncLock <Statement> MySharedMember=NewValue End SyncLock What the statement's supposed to be? Thanks ahead
-- Ram
-- Outgoing mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004
you can use a dummy string var for that
Public ThreadLock As String = "Lock Me"
i use this in a multithreaded app to lock callback routines
this was a tip in Programming visual basic.Net from F. balena
and works fine for me
hth
M.Posseth [MCP]
"Ram" <ni***@bezeqint.net> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl... Hey, I have about 5 Shared variables, that I want to be locked for access when they are written to. I'v read in the MSDN about the SyncLock statement, and I'm prety sure
that's what I'm looking for, But the SycLock statement requires a statement in it's decleration: SyncLock <Statement> MySharedMember=NewValue End SyncLock What the statement's supposed to be? Thanks ahead
-- Ram
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ram |
last post by:
Hey,
I have about 5 Shared variables, that I want to be locked for access when
they are written to.
I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's
what I'm looking...
|
by: Bob Day |
last post by:
Using vs 2003, vb.net sql msde..
Consider the following code snippets. See **** for questions. All are
shared and accessed by multiple threads simultaneiously.
' Instantiate per for this...
|
by: Eric Newton |
last post by:
I find it curious that the Synclock...End Synclock do not emit a try finally
as well...
SyncLock Me
Me.someOperation()
End SyncLock
I would expect to see in the generated code:
try...
|
by: Bob Day |
last post by:
Ok, I have done a lot of reading(of the newsgroup answers, help files and
MSDN articles) of synclock.
I understand what you are saying in the newsgroup, and it is very helpful.
It does, however,...
|
by: Johan Karlsson |
last post by:
Hi all!
I just need a true or false answer for this statement.
Consider having a piece of code that boils down to this
Dim a = new ArrayList
SyncLock a
SyncLock a
a.Add("Something")
End...
|
by: Jeff Stewart |
last post by:
Specifically, I don't understand the parameter that Synclock accepts. How
is a reference type a lockable entity? What -is- a reference type? Is it a
number? Is it a value at a specific memory...
|
by: j3ko |
last post by:
Hi, I'm trying to start a thread that constantly iterates through an
arraylist of items that the main thread adds and removes from...how
would I accomplish this?
Here's the gist of what I have:...
|
by: Perecli Manole |
last post by:
Can an Exit Sub statement in a SyncLock block cause any problems with the
proper release of the locked resource or affect the Monitor's waiting queue
in any way?
Thanks
Perry
|
by: HONOREDANCESTOR |
last post by:
I have a buffer that needs to be locked sometimes, because 2 processes
update it.
So I made the buffer into a class and whenever there is code that
affects it, I sandwich the code between
...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
| |