473,386 Members | 1,702 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,386 software developers and data experts.

Synclock

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
Nov 19 '05 #1
5 5424
Niclas,
The code running on the server would need to do use 'Synclock' or one of the
other locks found in the System.Threading namespace.

SyncLock uses System.Threading.Monitor which locks the object locally (on
the client). The 'cost' of having Synclock locking remotely would be too
high, as SyncLock is used to keep two thread synchronized.

Hope this helps
Jay

"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #2
Hi, SyncLock is only for your threads running in your assembly and the
objects exposed in your assembly.

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
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

Nov 19 '05 #3
Tom,

I am not sure i understand, should i use synclock in my threads on the
client side when instantiating the remoting object ? or is synclock to be
used on the server side

Thanks for helping out

Niclas
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, SyncLock is only for your threads running in your assembly and the
objects exposed in your assembly.

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
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


Nov 19 '05 #4
It can't be used for what you are trying to do, if you see Jay B. Harlow's
post, it explains how Remote SyncLocking is a great strain on resources, and
can't be implemented easily. The VB SyncLock is only local, and cannot be
used for what you are trying to do.

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:#z**************@TK2MSFTNGP09.phx.gbl...
Tom,

I am not sure i understand, should i use synclock in my threads on the
client side when instantiating the remoting object ? or is synclock to be
used on the server side

Thanks for helping out

Niclas
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, SyncLock is only for your threads running in your assembly and the
objects exposed in your assembly.

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
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



Nov 19 '05 #5
Niclas,
You can use a synclock on the client side, only one client will honor them.

If you want to use synclock for the 'remoting object' itself, you will need
to use it on the server side itself.

Hope this helps
Jay

"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Tom,

I am not sure i understand, should i use synclock in my threads on the
client side when instantiating the remoting object ? or is synclock to be
used on the server side

Thanks for helping out

Niclas
"Tom Spink" <th**********@ntlworld.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, SyncLock is only for your threads running in your assembly and the
objects exposed in your assembly.

--
Happy to help,
-- Tom Spink
(th**********@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit
"MS Newsgroups" <li*************@hotmail.com> wrote in message
news:ew**************@TK2MSFTNGP12.phx.gbl...
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



Nov 19 '05 #6

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

Similar topics

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...
3
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,...
4
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...
7
by: SD | last post by:
I have a public object that I only want one thread to access at a time. However the access to this object is not limited to one procedure. Will SyncLock work in this case? If not what options do I...
1
by: fred | last post by:
I have a VB application that is using MS Access as its database. To avoid connection delays the application creates one connection to the database at start-up and maintains that single connection...
3
by: Chris Dunaway | last post by:
I was using a Queue object like this to create my own specialized queue class for use with my own objects: Public Class MySpecializedQueue Private q As New Queue Public Sub Enqueue(obj As...
2
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:...
2
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 ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
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...
0
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,...
0
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...

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.