473,383 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

synchronized method in vb.net

Hi there,

How can I create synchronized method in vb.net like synchronized method in
Java?

Thanks in advanced

Alan
Mar 24 '06 #1
7 7241
"Alan Wang" <wa**@vdata.com> schrieb:
How can I create synchronized method in vb.net like synchronized method
in Java?


Check out the 'SyncLock' keyword.

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

Mar 24 '06 #2
Alan,

Beside the synchronized method is the Queue class in Net a very handy class.

I hope this helps,

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:OI**************@TK2MSFTNGP12.phx.gbl...
Hi there,

How can I create synchronized method in vb.net like synchronized method
in Java?

Thanks in advanced

Alan

Mar 25 '06 #3
Herfried,

How about define class as <Synchronization()>?

Thanks

Alan
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
"Alan Wang" <wa**@vdata.com> schrieb:
How can I create synchronized method in vb.net like synchronized method
in Java?


Check out the 'SyncLock' keyword.

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

Mar 27 '06 #4
Cor,

How about define class as <Synchronization()>?

Thanks

Alan
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Alan,

Beside the synchronized method is the Queue class in Net a very handy
class.

I hope this helps,

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:OI**************@TK2MSFTNGP12.phx.gbl...
Hi there,

How can I create synchronized method in vb.net like synchronized method
in Java?

Thanks in advanced

Alan


Mar 27 '06 #5
Alan,

I never saw this, if you want a discussion about this, than I would in your
case ask this again in the newsgroup

microsoft.public.dotnet.general

Jon Skeet is active in that, he is using Java as much as C#.

Therefore have I the idea that he can give you much more information in the
line of what you think about synchronized. For us is it a method with
multithreading.

You are of course welcome here, it is just to get a better one to answer
you.

(Do not forget to add "as in Java" to your subject)

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:ul**************@TK2MSFTNGP10.phx.gbl...
Cor,

How about define class as <Synchronization()>?

Thanks

Alan
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Alan,

Beside the synchronized method is the Queue class in Net a very handy
class.

I hope this helps,

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:OI**************@TK2MSFTNGP12.phx.gbl...
Hi there,

How can I create synchronized method in vb.net like synchronized method
in Java?

Thanks in advanced

Alan



Mar 27 '06 #6
Cor,

Thanks, I will do that.

Alan
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Alan,

I never saw this, if you want a discussion about this, than I would in
your case ask this again in the newsgroup

microsoft.public.dotnet.general

Jon Skeet is active in that, he is using Java as much as C#.

Therefore have I the idea that he can give you much more information in
the line of what you think about synchronized. For us is it a method with
multithreading.

You are of course welcome here, it is just to get a better one to answer
you.

(Do not forget to add "as in Java" to your subject)

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:ul**************@TK2MSFTNGP10.phx.gbl...
Cor,

How about define class as <Synchronization()>?

Thanks

Alan
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uE**************@tk2msftngp13.phx.gbl...
Alan,

Beside the synchronized method is the Queue class in Net a very handy
class.

I hope this helps,

Cor

"Alan Wang" <wa**@vdata.com> schreef in bericht
news:OI**************@TK2MSFTNGP12.phx.gbl...
Hi there,

How can I create synchronized method in vb.net like synchronized
method in Java?

Thanks in advanced

Alan



Mar 27 '06 #7
Alan,

There are two SynchronizationAttribute classes. One is in
System.EnterpriseServices and the other is in
System.Runtime.Remoting.Contexts. The first can only be used on
classes derived from ServicedComponent. The second can only be used on
classes derived from ContextBoundObject. Based on that I don't think
either Synchronization attribute fits the OP's situation.

Brian

Alan Wang wrote:
Cor,

How about define class as <Synchronization()>?

Thanks

Alan


Mar 27 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frank | last post by:
Hi, In the javadocs regarding many of the java.util classes, it states that the classes are not synchronized, and suggest using the Collections.synchronizedX(...) methods for getting...
5
by: Max Ischenko | last post by:
Hi, I wrote simple implementation of the "synchronized" methods (a-la Java), could you please check if it is OK: def synchronized(method): """ Guards method execution, similar to Java's...
4
by: chrisben | last post by:
Hi I often use Queue.Synchronized method to create a queue for multithread writing. I also know I could use SyncRoot and lock to write Queue. Could anyone here please explain to me the pros and...
5
by: Seeker | last post by:
Hello, I've read conflicting posts about . Does it or does it not lock the entire object? In my simple test it appears to block just the method but I wouldn't exactly call my meager test...
6
by: rmunson8 | last post by:
I have a derived class from the Queue base class. I need it to be thread-safe, so I am using the Synchronized method (among other things out of scope of this issue). The code below compiles, but...
5
by: norbert.thek | last post by:
Hi Can somebody tell me if I'm right or not The attribute Is like an lock(this) over the Method where i put this Attribute?! If I have two methods like:
8
by: ASP.Net programmer | last post by:
Hi, I have a few methods in a class that I want to synchronize (make sure they can't be used at the same time by multiple threads). As a Java programmer I just do this: public synchronized...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
3
by: Ryan Liu | last post by:
Hi, What does ArrayList.Synchronized really do for an ArrayList? Is that equal to add lock(this) for all its public methods and properties? Not just for Add()/Insert()/Remvoe()/Count, but also...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.