PC Review


Reply
Thread Tools Rate Thread

Critical Sections

 
 
=?Utf-8?B?TWFyaw==?=
Guest
Posts: n/a
 
      17th Nov 2004
Now that VB is multithreaded, are there any critical sections?
Thanks
Mark
 
Reply With Quote
 
 
 
 
OHM \( Terry Burns \)
Guest
Posts: n/a
 
      17th Nov 2004
Can you be more specific ?

"Mark" <(E-Mail Removed)> wrote in message
news:B6CB559E-13D7-421C-901E-(E-Mail Removed)...
> Now that VB is multithreaded, are there any critical sections?
> Thanks
> Mark



 
Reply With Quote
 
David Browne
Guest
Posts: n/a
 
      17th Nov 2004

"Mark" <(E-Mail Removed)> wrote in message
news:B6CB559E-13D7-421C-901E-(E-Mail Removed)...
> Now that VB is multithreaded, are there any critical sections?
> Thanks


Every object has a Monitor which you can use to control concurrency. Only
one thread can enter a Monitor at a time.

VB has the SyncLock keyword to allow you to use a block of code to
enter/exit a Monitor.

Shared objects are shared among all object instances and threads, so any
shared object can be used like a critical section.

EG

class MyClass
public shared readonly SyncRoot as new Object()

public shared sub DoSomething()
SyncLock SyncRoot
'only one thread at a time in here
end SyncLock
end sub

end class



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      17th Nov 2004
"Mark" <(E-Mail Removed)> schrieb:
> Now that VB is multithreaded, are there any critical sections?


Take a look at 'SyncLock' and the 'Monitor' class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      18th Nov 2004

"Herfried K. Wagner [MVP]"
..
>> Now that VB is multithreaded, are there any critical sections?

>
> Take a look at 'SyncLock' and the 'Monitor' class.
>

Are you sure that that is all?

I think that I have to disagree with you about that.

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      18th Nov 2004
"Cor Ligthert" <(E-Mail Removed)> schrieb:
>>> Now that VB is multithreaded, are there any critical sections?

>>
>> Take a look at 'SyncLock' and the 'Monitor' class.
>>

> Are you sure that that is all?
>
> I think that I have to disagree with you about that.



?!?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      18th Nov 2004

"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)>

> "Cor Ligthert" <(E-Mail Removed)> schrieb:
>>>> Now that VB is multithreaded, are there any critical sections?
>>>
>>> Take a look at 'SyncLock' and the 'Monitor' class.
>>>

>> Are you sure that that is all?
>>
>> I think that I have to disagree with you about that.

>
>

When you read your message you can get the idea that you say that this are
the only critical things, I think that is not right, therefore just to
protect you a little bit.

The only thing you had to write was, no I did not mean that.

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      18th Nov 2004
"Cor Ligthert" <(E-Mail Removed)> schrieb:
>>>>> Now that VB is multithreaded, are there any critical sections?
>>>>
>>>> Take a look at 'SyncLock' and the 'Monitor' class.
>>>>
>>> Are you sure that that is all?
>>>
>>> I think that I have to disagree with you about that.

>
> When you read your message you can get the idea that you say that this are
> the only critical things, I think that is not right, therefore just to
> protect you a little bit.


"Critical section" is a term with a special meaning in the field of process
synchronization/"multithreading".

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Critical Sections of code Sid Price Microsoft VB .NET 5 6th Oct 2005 06:10 PM
Critical Sections & Threading MPH Computers Microsoft VC .NET 6 14th Mar 2005 02:03 AM
c# and critical sections Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 7 3rd Aug 2004 09:48 AM
critical sections in win2000 Server Piotrek Stachowicz Microsoft Windows 2000 0 2nd Aug 2004 03:41 PM
Critical Sections and Static Methods blue Microsoft ASP .NET 2 5th Feb 2004 07:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:40 AM.