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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:05:19+00:00 2026-05-26T04:05:19+00:00

I am developing a library class that uses a serial port to communicate with

  • 0

I am developing a library class that uses a serial port to communicate with a control circuit. If more sensors are installed then it takes longer for the circuit to send the response string. For example, if only one sensor is installed I should wait 100ms before reading the input buffer but if 6 sensors are installed I should wait 100ms + 6 * 20ms. For some of the functions (if the maximum number of sensors are attached) I may need to wait up to 9 seconds before the controller sends the response string.

My question is should I setup multi-threading within the library class or should that responsibility be left to the client code?

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-26T04:05:19+00:00Added an answer on May 26, 2026 at 4:05 am

    It’s up to you whether you want the library to be implemented in such a way that a callback happens when the process completes, or if you just want to block the thread and allow the front end developer to do what they want with multithreading.

    I’d say just blocking the thread is easiest from the library’s standpoint, and is probably the most expected (it sounds like a simple setup, I wouldn’t expect any kind of complicated thread management built in), just make sure to document it’s behavior so the next developer can easily make a choice on whether or not they want to thread it out.

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

Sidebar

Related Questions

I am developing a class library (C#) that i will use it for my
I am developing a class library that will be used in several projects. In
I'm developing a class library in .NET that other developers will consume eventually. This
I'm about to set out on developing a .NET class library that will be
I'm developing a technical library class that can be used on both types of
I'm developing an WPF application that has an reference of a C# Class Library.
I'm developing a class library that implements a protocol stack. There I have an
I am developing a software that uses ActiveMQ C++ library. The problem that I
I'm developing a class library that will be used in a number of different
I am developing a C++ class library containing domain model classes, and I would

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.