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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:46:08+00:00 2026-05-13T05:46:08+00:00

I cannot find any information about the thread-safety of the waveOut API. After i

  • 0

I cannot find any information about the thread-safety of the waveOut API.

After i creating new waveOut handle, i have those threads:

Thread 1: Buffers handling. Uses those API functions:

  • waveOutPrepareHeader
  • waveOutWrite
  • waveOutUnprepareHeader

Thread 2: Gui, Controller thread. Uses those API functions:

  • waveOutPause
  • waveOutRestart
  • waveOutReset
  • waveOutBreakLoop

Those two threads are running while using concurrently the same waveOut handle.
In my tests, i didn’t saw any problem with the functionality, but it doesn’t mean that it safe.

Is this architecture thread-safe?
Is there any documentation about the thread safety of the waveOut API?
Any other suggestions about the waveOut API thread-safety?

thanks.

  • 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-13T05:46:08+00:00Added an answer on May 13, 2026 at 5:46 am

    In general the waveOut API should be thread-safe. Because usually a waveOutOpen() creates its own thread, and all waveOut* functions send messages to that thread. But I can not give you a proof…

    However, you can change your application to make it safe in any case:

    1. start your thread for buffer management, remember dwBufferThreadId
    2. from GUI thread call waveOutOpen with dwCallback set to dwBufferThreadId and fdwOpen to CALLBACK_THREAD
    3. your buffer management thread: “waveOutWrite” some buffers in advance, the loop on GetMessage()
    4. waveOutOpen will send a WOM_DONE whenever a buffer is finished and a new buffer is required, this is the moment to waveOutWrite a new buffer from within that thread
    5. make your calls to waveOutPause, waveOutRestart and so on from GUI thread (nothing in MSDN speaks against it, and all examples do this, even if the buffers will be filled from another thread)

    example 1

    If you want to be 100% sure, you could just grab a windows message (WM_USER+0), and call PostThreadMessage( WM_USER+0, dwBufferThreadId, MY_CTL_PAUSE,0 ) and then upon receiving that message in your buffering thread, you call waveOutPause() there. Windows message queues save you some work on writing your own message queues 😉

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

Sidebar

Related Questions

I have searched extensively and cannot for the life of me find any information
I cannot for the life of me find any information on the internet about
I cannot find any information anywhere (google, cocoadev, developer.apple) about managing an optional to-one
Cannot find any developer information about this function. I just know that it's suggested
I cannot for the life of me find any information about where this moved
I am implementing an AbstractAccountAuthenticator and I cannot find any information regarding the dimensions
I'm surprised that I cannot find much information on the internet about this. I
Cannot find any example on Google.
i cannot find any documentation of this project
I'm missing something, but I cannot find any hint online. When I use Javascript's

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.