473,661 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Synclock in IIS Hosted Remoting - Single Threading Function Call?

Hi all,

I'm hosting a remoting service in IIS. I have a function which I only want
one concurrent access at a time. Will this prevent multiple users from
accessing the function at a paritcular time?

'Empty object used for sync locking purposes
Private Shared MySyncLockObjec t as new Object

'Only want 1 user to acces function at a time
Public Sub SingleThreadedS ubProcedure
Synclock MySyncLockObjec t
'Code in here...
End Synclock
End Sub

Will Synclock globally restrict access to the sub to a single thread at a
time?
Feb 28 '07 #1
1 1565
Hi, Spam Catcher:

Two key points for multithreading programming:

1. Make sure that you need to lock MySyncLockObjec t everywhere, if
you want to access the variable from different threads.

2. Make sure that you need to release lock as early as possible so
that thread contention is reduced to the lowest level. This requires you to
have clear understanding of your business requirements, and design a good
locking algorithm. If your locking algorithm is not well designed and coded,
you will find your server application doesn't support mutlithreading (or
multi-core) well. This is the most challenge aspect in multithreading
programming.

Regards,

Do you know batching, asynchrony and parallel computation with online
compression? See the sample project SocketPro at www.udaparts.com

"Spam Catcher" <sp**********@r ogers.comwrote in message
news:Xn******** *************** ***********@127 .0.0.1...
Hi all,

I'm hosting a remoting service in IIS. I have a function which I only want
one concurrent access at a time. Will this prevent multiple users from
accessing the function at a paritcular time?

'Empty object used for sync locking purposes
Private Shared MySyncLockObjec t as new Object

'Only want 1 user to acces function at a time
Public Sub SingleThreadedS ubProcedure
Synclock MySyncLockObjec t
'Code in here...
End Synclock
End Sub

Will Synclock globally restrict access to the sub to a single thread at a
time?

Mar 1 '07 #2

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

Similar topics

15
2072
by: JJ | last post by:
A current requirement I am facing is the all business objects be stateless remote components hosted in IIS. I am partial to web services myself. However, it is insisted that IIS hosted remoting be used. They insist that it is much, much faster. I don’t necessarily disagree with that point. But under the circumstances, a web service that is load balanced (as are the remote objects), though technically slower, would still have a lot of...
5
5439
by: MS Newsgroups | last post by:
Hi, If i have a remoting component hosted on a server that exposes a method that does some file IO operations, and i want to avoid this method to be run at the same time from client applications to avoid file locks, can I use synclock before the method is called from the client app to achieve this ? Niclas
12
3048
by: Keith Langer | last post by:
I have some questions about whether synclock is necessary in a few different scenarios: 1) I have a Queue class which is shared between two threads. Thread 1 pushes objects onto the queue and Thread 2 pops objects off the queue one at a time (with no enumerators - just first in, first out). Does the Queue class need to be synclocked when objects are pushed on or popped off? 2) I have a boolean variable which can be read or written...
4
3786
by: fred | last post by:
If I have multiple threads running a Sub as below then a number of threads can be held up at the SyncLock. When it becomes free which thread goes first. Is it just by chance which thread goes first or do the threads queue in a FIFO or perhaps a LIFO bases. Thanks Fred Sub SomeWork()
6
2730
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 SyncLock
2
1696
by: Spam Catcher | last post by:
Hi all, I'm hosting a remoting service in IIS. I have a function which I only want one concurrent access at a time. Will this prevent multiple users from accessing the function at a paritcular time? 'Empty object used for sync locking purposes Private Shared MySyncLockObject as new Object 'Only want 1 user to acces function at a time
0
1357
by: n.vaughan | last post by:
People. I'm struggling with an issue here. The .Net2.0 application i'm developing makes use of both the WebBrowser control and controls hosted with this. When the document has loaded i check the DOM through an GetElementsByTagName( "object" ) call to get references to the objects hosted in IE.
10
4099
by: Frank Osterberg | last post by:
Hi, I want to simultaneously SyncLock multiple objects, something like: SyncLock objA, objB ' do stuff with objA and objB
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8855
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8758
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4346
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.