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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:26:15+00:00 2026-05-12T17:26:15+00:00

All: I am writing a logging solution. One of the available log endpoints is

  • 0

All:

I am writing a logging solution. One of the available log endpoints is a text file. Suppose I wanted to write to that file from multiple processes: I could open it shared, and use a named mutex to control concurrent access to the file (assuming all access occurred on the same machine). But then I started wondering about async IO. Within a process, I could use BeginWrite to issue my writes asynchronously. What about cross-process, or cross-machine issues? Is async IO safe in those situations?

(assuming that when I call BeginWrite(), the buffer that I pass contains everything that should be kept together in one logical “record”)

  • 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-12T17:26:15+00:00Added an answer on May 12, 2026 at 5:26 pm

    Before you decide on the async IO solution, note that very often what you think will be an async write ends up being handled synchronously. Particularly important for your logging solution is a little tidbit hidden in Asynchronous Disk I/O Appears as Synchronous on Windows NT, Windows 2000, and Windows XP. Buried there in the discussion is this nugget:

    “On Windows NT, any write operation to a file that extends its length will be synchronous.”

    Although that says “Windows NT,” my experience has been that it’s true for Windows 2000, Windows XP, and Server 2003 as well. I think they meant “NTFS” rather than “Windows NT”. I haven’t tested it on Vista or Server 2008.

    The article goes on to provide possible solutions to that limitation. I assume they work, but haven’t actually tried them.

    The most reliable solution I’ve found is to spawn a thread that does a synchronous write. Kind of a pain in the neck, true, but effective.

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

Sidebar

Related Questions

I am writing a quick and dirty application that reads all the files from
I'm going to write a CMS, but right now I'm writing down all my
I'm writing a database of all DVDs I have at home. One of the
I am writing a logging service for one of my applications but I am
I'm writing a DDE logging applet in visual c++ that logs several hundred events
When writing a new application or infrastructure, do you consider logging right from the
I'm using the Console.SetOut method to write all my Console.Out.WriteLines to a file, and
I'd like to keep a log of all searches that users do on my
I am working on a solo project, writing all code myself so no collaboration
In the following program, loop is iterating 1000 times, and I am writing all

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.