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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:23:05+00:00 2026-05-15T04:23:05+00:00

A byte stream should be transferred and there is one producer thread and a

  • 0

A byte stream should be transferred and there is one producer thread and a consumer one.
Speed of producer is higher than consumer most of the time, and I need enough buffered data for QoS of my application.
I read about my problem and there are solutions like shared buffer, PipeStream .NET class …
This class is going to be instantiated many times on server so I need and optimized solution.
Is it good idea to use a Queue of ByteArray ?

If yes, I’ll use an optimization algorithm to guess the Queue size and each ByteArray capacity and theoretically it fits my case.

If no, I what’s the best approach ?

Please let me know if there’s a good lock free thread safe implementation of ByteArray Queue in C# or VB.

Thanks in advance

  • 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-15T04:23:06+00:00Added an answer on May 15, 2026 at 4:23 am

    Most important part is the design of the shared object. In my scenario reader and writer can use separate buffers (big data chunks) independently and then, only accessing a shared FIFO object like a queue should be synchronized. This way lock time is minimized and threads can complete the job in parallel. And with .NET framewok 4.0 implementation of this concept made easy :

    There’s a ConcurrentQueue(Of T) Class in System.Collections.Concurrent namespace and arrayByte is a good type to use as queue type for my scenario. There are other thread-safe collections in the namespace.

    http://msdn.microsoft.com/en-us/library/system.collections.concurrent.aspx

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

Sidebar

Related Questions

I have a byte stream I need parsed into a struct, and I also
I need to get the byte stream of an object in C++. I could
Possible Duplicate: How do I convert byte[] to stream in C#? I need to
I'm using System.IO.Stream.Read(byte[] buffer, int offset, int count) . Is there an alternative to
I have a byte stream that may be UTF-8 data or it may be
I want to write a raw byte/byte stream to a position in a file.
I ask because I am sending a byte stream from a C process to
I'm reading from a byte stream that contains a series of variable length descriptors
I have client-server app. Client on C++, server on Java. I am sending byte-stream
I am getting a stream of byte data from a telnet session via TcpClient.GetStream().ReadByte()

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.