473,795 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading locks with remoting

I have a project where we have a windows service that creates a
remoting object for an external client application to communicate with
using ipc. We've discovered the client is making updates to the class
fields by calling the update methods in the remoting object class and
while thats not an issue I'm curious about threading with remote calls.

I can't find much in the way of what threading issues can occur. If
the service's thread (which instantiates the remoting class) calls
method A() through a proxy class attained through
Activator.GetOb ject() while the client calls method A(). Does the
proxy class returned by Activator.GetOb ject have any thread safety to
it, being that it's dealing with two objects (client and server) that
are possible callers, or do I need to add my own thread safety code to
the class?

Is it possible to lead to a deadlock via a remote call and if so would
the remote call ever terminate or would that lead to a system issue
requiring a reboot?

Dec 20 '05 #1
2 3981
Greg,

I would imagine that the proxy itself would be thread-safe. I can't
guarantee this, but I would imagine that the proxy is just sending messages
to the server, which doesn't require a good deal of shared state (at least,
updating it at the same time).

However, on the server side, if you are using a singleton instance, then
you have to worry about thread safety on the instance that is created.
That's where you will have to pay attention.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<gr***********@ gmail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
I have a project where we have a windows service that creates a
remoting object for an external client application to communicate with
using ipc. We've discovered the client is making updates to the class
fields by calling the update methods in the remoting object class and
while thats not an issue I'm curious about threading with remote calls.

I can't find much in the way of what threading issues can occur. If
the service's thread (which instantiates the remoting class) calls
method A() through a proxy class attained through
Activator.GetOb ject() while the client calls method A(). Does the
proxy class returned by Activator.GetOb ject have any thread safety to
it, being that it's dealing with two objects (client and server) that
are possible callers, or do I need to add my own thread safety code to
the class?

Is it possible to lead to a deadlock via a remote call and if so would
the remote call ever terminate or would that lead to a system issue
requiring a reboot?

Dec 24 '05 #2
Testing showed us that the proxy code coming from multiple clients can
call the same remoted method with no thread safety and cause issues, so
I converted the remoted class to a singleton instance.

We managed to instance the remoted class in the server and get local
access to it's members via activator.getob ject while getting another
instance lock using the client. Twice we were able to cause a stack
fault in the windows service (the server) by getting a deadlock. The
clients exception catch never even fired, the application simply died.

..NET 2 was nice in catching the lock from within the service and
brought me to the calling code in vs2005 which is a lot better than
what vs2003 was able to do for me.

Dec 24 '05 #3

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

Similar topics

12
1753
by: Gurpreet Sachdeva | last post by:
I have written a code to figure out the difference in excecution time of a func before and after using threading... #!/usr/bin/env python import threading import time loops =
2
1378
by: Brad Quinn | last post by:
I have a WebApplication that uses tcp/binary remoting to communicate with remote objects hosted by a Windows Service on another machine. The WebApplication takes an XML post (~200K) and turns that into about 300 remoting calls. There is another WebApplication and a WebService running on this box. What I'm finding is that occasionally the Web Server locks up. If I restart the Web Server any new requests are processed just fine. The...
6
1318
by: Morten Snedker | last post by:
I have this Class: Imports System.Net Public Class DownloadFile Private _webClt As WebClient Private _url As String Private _file As String Sub New(ByVal urlSource As String, ByVal fileDestination As String)
1
1871
by: Antimon | last post by:
Hi, I have a single threaded server application except for async socket methods. Anyway, i need to host some remote objects but remoting mechanism spawns new threads for remote calls. I don't know about .net threading too much. On the sockets part, i can send a response with a delay, so i can exchange info with main thread using queues, generate a response on main thread and send it. But i need to do something to block client if i try...
13
6188
by: Brosto | last post by:
Hello, I'm writing a server client application and I'm having a terrible time getting one section to work. This is my first time using .net remoting, so please bear with me if I'm doing something incorrectly. To give a brief layout of my program, the server side hosts a series of functions for running tests, this server application will run on four separate boxes. My client application has access to all four of the server...
2
1541
by: WXS | last post by:
When I see things in .NET 2.0 like obsoletion of suspend/resume because of the public reason MS gives of they think people are using them inappropriately.. use mutex, monitor and other synchronization objects instead and oh by the way you shouldn't be using them as they can cause deadlock and other major problems, screams bug or threading architecture issue and lack of willingness or priority to correct. In reality those API's are for...
2
1666
by: danielhamd | last post by:
I am somewhat new to the concept of remoting in c#. Here is my scenario, if anyone could give me some tips I would really appreciate it: I have a server program running that updates a database and a binary file every hour - this process takes approximately 10-15 seconds to complete. There are going to be 300-400 client machines that will have a client program running that connect to this server program every day at random times (such...
2
1833
by: =?Utf-8?B?TWljaGFlbCBNYWVz?= | last post by:
Hello, I have an Mdi-application which also is a remoting-server (Ipc). Several instances can co-exist on the same machine. I have a small app (search-engine) (remoting-client) which calls a sub on the MDI (specific instance) thus retrieving eg the data of a certain customer. If the customer childform is already instanciated, there is no problem. If the destination-childform is not yet open, it will be opened like this:
126
6756
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard: http://www.cse.wustl.edu/~schmidt/ACE.html the same way that the STL (and subsequently BOOST) have been subsumed? Since it already runs on zillions of platforms, they have obviously worked most of the kinks out of the generalized threading and processes idea (along with many...
0
9673
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
9522
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
10448
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
10003
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...
0
9046
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.