Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 141745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:49:33+00:00 2026-05-11T07:49:33+00:00

I have an interesting design problem and I was hoping you all could make

  • 0

I have an interesting design problem and I was hoping you all could make some suggestions. I’m using C# and .NET 3.0

I have a very nice, extensible framework built on top of WCF that automates the setup of endpoints and the creation of contracts. The system I’m working in could be run in different ways – endpoints could be somewhere else on the internet, running in different assemblies on the same box, or even running in the same process. WCF is great for making all of this transparent, but in the last case, I’d like to improve efficiency:

I’d love to avoid the overhead of serializing objects that aren’t really going anywhere. There’s really no point in doing that to communicate between two threads in the same assembly. At the same time, I’d like to utilize the WCF-based framework that’s already in place, because it will be a lot easier to maintain if we don’t have two separate communications pathways depending on the setup of the system.

My first thought was to use object pointers in an unsafe context – to not fight the serialization, but to only serialize the minimum amount. My concern with this is that on asynchronous messages in environments where the GC is being aggressive, the message might and probably will be gone before we have a chance to dereference the pointer contained in it, which would lead to plenty of issues.

My next thought was to use GCHandles, but I’m unsure about their behavior – if a GCHandle isn’t referenced anymore, but contains a reference to a managed object, are both cleaned up by the GC, or neither? I’m worried about introducing a huge memory leak by using these, because the chance that a message will get lost is great, and we won’t be able to call Free(), and the documentation I can find is… lacking.

Another thought is to use reflection to look at all managed objects, but it seems like the overhead for this would be huge, and this system must be as efficient as possible.

So, in summary, I’m trying to send an object across a process with WCF without serializing it, which as far as I can tell means keeping it alive even if it temporarily has no references. It seems like it should be possible, but I wonder if I’m trying to have my cake and eat it too.

Thank you so much for your input!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:49:34+00:00Added an answer on May 11, 2026 at 7:49 am

    I would investigate the ‘NetNamedPipes’ transport protocol in WCF which is specifically designed for same-machine, inter-process communication and which has the least overhead possible (including fast binary serialization).

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some interesting problem for an hour.. In my flex project, all width
So I have an interesting design problem. I am working on SLES 9+ Linux,
I have experienced a frustrating and interesting problem. The design I am working on
I am facing a very interesting problem. I have tested the Delay job gem
I have an interesting problem which I've been looking into and would appreciate some
We have an interesting problem with WCF binding and streaming transfer mode that we
I have an interesting SQL problem that I need help with. Here is the
I have an interesting algorithm problem here. The problem is in a way related
So I have an interesting design question regarding an app I'm developing for the
I have met an interesting problem while implementing the Observer pattern with C++ and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.