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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:44:00+00:00 2026-06-01T13:44:00+00:00

I am currently writing a bulk processing algorithm for pitch detection in audio being

  • 0

I am currently writing a bulk processing algorithm for pitch detection in audio being streamed from disk. I have tightened up my algorithm such that it runs in nearly real-time for serially streamed data.

Ideally I would like the system to be working way faster than real-time such that I could hand it real-time data and after a not huge delay be generating the pitch track data.

Now the thing that strikes me is that the serial processing of the data is where I could provide a hell of a lot of speedup. I’m running on a quad core i7 (with 8 hardware threads) so I ought to be able to improve the speed significantly by spreading processing across multiple blocks.

As it goes I currently do the following:

  1. Stream data off disk
  2. Buffer data until I have the window size that I wish to analyse.
  3. Process the window of data.
  4. Copy the data back n-samples (where n is the amount I want to slide (this can be as low as 1ms back in an 80ms window!)
  5. rinse and repeat.

Now it strikes me that once I have a window I could easily copy that data into a given thread work buffer (as well as providing a memory location the result will be written to). This way I could, effectively buffer up to 7 (Leave thread 8 open to pump the data) threads worth of data that a thread pool would then process.

When I try to submit the 8th window of audio I want the pool to block until a thread is available to process the data and so on. The idea being that I would keep 7 threads constantly working processing the data. From previous experience I would expect to see about 5x speed up from doing this.

In the past I have written under C++ my own task based system that would do the job perfectly but this app is being developed under C#. To get good parallelism with low overhead under C++ I spent significant amounts of time building a good lockless queueing mechanism.

I was rather hoping, under C#, that someone would have taken the pain out of doing this for me. However I can’t find anything that would seem to work. I’ve looked at System.Threading.ThreadPool and it appears to have no way of checking how many threads are currently in action. Not to mention that the overheads seems prohibitive. The big problem then arises that I can’t re-use an existing pre-allocated structure (which is important in my processing) forcing me to re-create it each time I submit a work item. This has the huge disadvantage that I then generate work quicker than I can process it so not only do I end up wasting tonnes of time setting up structure and workspaces that I really ought not to need but my memory usage spirals out of control.

I then found out about System.Threading.Tasks but that too doesn’t seem to offer the functionality I’m after.

I guess I could just use my C++ Task Manager via interop but I really assumed that in this day and age someone would already have set up something similar. So am I missing something? Or can anyone provide me with a link to such a task management engine?

  • 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-06-01T13:44:01+00:00Added an answer on June 1, 2026 at 1:44 pm

    Task Parallel Library was designed and implemented especially for tasks you are trying to solve! Also you can pipeline this process as well.

    So you have to ensure:

    • You can run on .NET Framework 4.X
    • You are familar with Pipelines design pattern
    • You are familar with .NET Framework 4 BlockingCollecition class (BlockingQueue implementation especially to simplify solving of the Producer Consumer problem)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The application I'm currently writing is using MVVM with the ViewModel-first pattern. I have
I am currently writing a distributed system using hazelcast. I have a few questions
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP
I'm currently writing a small test Android app, and have run across a small
I'm currently writing an custom control which has to hold child control and have
I am currently writing an application that requires bulk operations on a key/value store,
We have a console application (currently .NET) that sends out mail in bulk to
I am currently writing a MEX function that will have to work with a
I'm currently writing a Java app that interfaces with a MySQL database. My problem
I'm currently writing a helper function in VB.NET to convert an array of enum

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.