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

  • Home
  • SEARCH
  • 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 664095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:33:43+00:00 2026-05-13T23:33:43+00:00

I was provided by an tracing API which was developed in house which directly

  • 0

I was provided by an tracing API which was developed in house which directly writes to database on the same thread of the caller. I didnt like the approach. I thought an implementing custom database tracelistner but wondering if it will run on a seperate low priority thread or do I have manage threading myself.

  • 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-13T23:33:44+00:00Added an answer on May 13, 2026 at 11:33 pm

    First, you shouldn’t try and set the priority of a thread. Generally speaking, it’s a bad idea, because thread priority elevation (or deelevation in this case) will be overriden by the OS in the event that it feels those threads are being starved (in the case of de-prioritizing the thread) or taking up too much time (in the case of elevation).

    That being said, in .NET, it’s very easy to make database calls aynchronously. For example, the SqlCommand class has a number of methods that use the Begin* pattern for asynchronous calls, and most other database providers in .NET follow suit.

    That being said, if your trace API allows for it, you should use one of these mechanisms to start the database operation, and then finish up in a callback you provide to the async mechanism.

    If you are not using a provider that allows for asynchronous calls, then you should probably use the ThreadPool class (specifically a call to QueueUserWorkItem) to queue an asynchronous operation (this assumes the trace operation is not lenghty).

    If you are using .NET 4.0, then you might even want to take a look at the classes in the System.Threading.Tasks namespace to do ThreadPool-like operations (there is a better API which allows for multiple pools, cancellation, and other features the ThreadPool doesn’t have).

    It should be noted that you should get all the relevant information you need to perform the operation before you start it. For example, you want to get the date/time of the operation before you make the asynchronous call, as you want that value to be reflective of the operation you are tracing, not the trace itself.

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

Sidebar

Related Questions

I am using some features that are provided in GCC v4+ and would like
Answers provided have all been great, I mentioned in the comments of Alnitak's answer
I provided some of my programs with a feedback function. Unfortunately I forgot to
The only method provided by the DNN framework to get a module by ID
Edit: From another question I provided an answer that has links to a lot
The expressiveness of the query languages (QL) provided with ORMs can be very powerful.
In ruby the library path is provided in $: , in perl it's in
I am trying to evaluate the answer provided here , and am getting the
I am using the date picker provided by jQuery UI to select a date
I am planning to extend the basic html input tag provided by Spring to

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.