473,383 Members | 1,872 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.

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 MySyncLockObject as new Object

'Only want 1 user to acces function at a time
Public Sub SingleThreadedSubProcedure
Synclock MySyncLockObject
'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 #1
2 1686
in general yes. but the lock is only honored in the current appdomain.
this means during a recycle, ongoing requests are handled in the old
appdomain, and new ones in the new appdomain. the lock will cause
queuing, so several requests could be process in the old domain.

if this is a problem for you, use an o/s mutex.

-- bruce (sqlwork.com)

Spam Catcher wrote:
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
Public Sub SingleThreadedSubProcedure
Synclock MySyncLockObject
'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
bruce barker <no****@nospam.comwrote in news:O88yRCDXHHA.3332
@TK2MSFTNGP04.phx.gbl:
in general yes. but the lock is only honored in the current appdomain.
this means during a recycle, ongoing requests are handled in the old
appdomain, and new ones in the new appdomain. the lock will cause
queuing, so several requests could be process in the old domain.

if this is a problem for you, use an o/s mutex.
I switched my code over to a mutex - which should work out great.

Thanks for the info :-)
Mar 7 '07 #3

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

Similar topics

15
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...
5
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...
12
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...
4
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...
10
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...
6
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...
1
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...
0
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...
10
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: 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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.