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 7699123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:24:18+00:00 2026-05-31T22:24:18+00:00

I have an expensive server side resource ( which is thread safe ). What

  • 0

I have an expensive server side resource ( which is thread safe ). What I want to provide is:

  • a remote REST interface, where other apps can submit data and get it processed

From non-functional perspective:

  • I want the expensive server side object to be Singleton, i.e., single instance will service all requests
  • I want to limit the number of requests being entertained – if there are more requests then the allowed pool, rest should wait in queue to get processed.

I can write custom code to accomplish above said, but I do not want do so. Its been a while since I have used WCF – anyone who can guide me in designing the architecture?

Regards.

FYI: due to licensing limitations I really cannot create more then one object instances.

  • 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. Editorial Team
    Editorial Team
    2026-05-31T22:24:19+00:00Added an answer on May 31, 2026 at 10:24 pm

    Why don’t you use the Object Pool pattern to control the lifetime of expensive server side objects?

    The Singleton and imposing restrictions on the number of requests sounds risky. Sooner or later it will take revenge on you because the number of clients will grow and your service will be inefficient. Also, Singletons are risky in a concurrent environment and if the Singleton has its own state, two or more concurrent requests will blow it up.

    On the other hand, you will have a complete control over your pool, how many expensive objects are created and when. And yes, you need a custom code.

    If you still need something out of the box, you can control your service with the ServiceBehavior attribute. The InstanceContextMode and ConcurrencyMode attributes will probably work as you expect – allowing you to set the Singleton mode and queue incoming requests (InstanceContextMode.Single and ConcurrencyMode.Single).

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

Sidebar

Related Questions

I have a somewhat expensive server-side operation that produces an image and some associated
I have an expensive query using the row_number over() functionality in SQL Server 2005.
I have a very expensive query which gets executed from php and it can
I have an ASP.NET 2.0 page with many repeating blocks, including a third-party server-side
I have a program in a remote server. The users of this program generate
I have a class Cache which is quite expensive to create, but after that
Generally the database server is the biggest, most expensive box we have to buy
I have been developing server side applications in java, and now I have been
I have a several very expensive queries which seem to hog resources that seems
I have a fairly expensive server call that I need to cache for 30

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.