473,570 Members | 3,027 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 3972
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
1727
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
1370
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...
6
1308
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
1860
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,...
13
6173
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...
2
1525
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...
2
1661
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...
2
1823
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...
126
6649
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...
0
7638
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...
0
8152
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...
1
7703
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8000
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...
1
5523
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...
0
5247
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...
1
2136
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
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
974
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...

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.