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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:04:05+00:00 2026-06-08T05:04:05+00:00

I am working on project where I have to communicate via serial port .

  • 0

I am working on project where I have to communicate via serial port. I will be receiving quite “large” amount of data from UART via RS232 (approximately 6KB/10ms) and I have to collect it and decode it. Decoded data will be stored to files and some of them will be shown in GUI.

I will be using C++/CLI (in Visual Studio 2010 using .NET v4.0) because of managed data work and large amount of libraries.

And my main question is: What would you recommend me:

A) To not use threads and look for data each 5ms via timer…

B) To not use threads and look for data based on event of incoming data…

C) Use threads…

What would you recommend me? I have not much experience to tell what will be the best solution.

Thank you for your future responses…

  • 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-08T05:04:07+00:00Added an answer on June 8, 2026 at 5:04 am

    If you need a gui, you will need a seperate thread to get the data. There’s no way to reliably get data each x mSec and process it in a ui thread.

    Apart from that you seem somehwat confused about what a thread does: A and B can be combined with C. I’d recommend using a seperate thread polling the port for data or use an event to check when new data arrives. Timer might be inaccurate, and after all it’s the port dictating at what rate the data comes in so it’s better to listen to that instead of using a seperate timebase. Store the processed data on a queue (aka producer) and have yet another thread (aka consumer) get large chunks from the queue to flush them to files (you do not want to write a file every 5mSec, instead write a large amount of data in one go every 100mSec or so).
    The ui thread can then also preview from that queue and displays pieces of the data.

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

Sidebar

Related Questions

I'm working on a project where I have to take data from one source
I'm working on a project to communicate to the serial ports using Java. Do
I'm working on a project where I communicate serialized commands over TCP/IP. I have
I working on project and have problem with threading and update of UI. I
I have a working project that Im amending, it crashes after trying to use
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
I am working on project where I have the checkInternet method in one of
I’m working on a project and have developed the high level user requirements for
I am working on a project and have the following psuedocode: // create a
Working on a project where they have lots of enums and lots of duplicated

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.