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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:46:56+00:00 2026-05-12T06:46:56+00:00

Or, equivalently, how would you design such an API. Expected/example usage would be illustrative

  • 0

Or, equivalently, how would you design such an API. Expected/example usage would be illustrative as well.

My curiosity comes directly from the comments (and subsequent editting on my part) of this answer. Similar questions/discussions in the past provide a bit of inspiration to actually asking it.

Executive summary:
I don’t feel a multithreaded UI api is possible in a meaningful way, nor particularly desirable. This view seems somewhat contentious and being a (relatively) humble man I’d like to see the error of my ways, if they actually are erroneous.

*Multithreaded is defined pretty loosely in this context, treat** it however makes sense to you.


Since this is pretty free-form, I’ll be accepting whichever answer has the most coherent and well supported answer in my opinion; regardless of whether I agree with it.

Answer Accepted


**Ok, perhaps more clarification is necessary.

Pretty much every serious application has more than one thread. At the very least, they’ll spin up an additional thread to do some background task in response to a UI event.

I do not consider this a multithreaded UI.

All the UI work is being done on single thread still. I’d say, at a basic level, a multithreaded UI api would have to do away with (in some way) thread based ownership of UI objects or dispatching events to a single thread.

Remeber, this is about the UI api itself; not the applications that makes use of it.

  • 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-12T06:46:57+00:00Added an answer on May 12, 2026 at 6:46 am

    I don’t see how a multithreaded UI API would differ much from existing ones. The major differences would be:

    • (If using a non-GC’d language like C++) Object lifetimes are tracked by reference-counted pointer wrappers such as std::tr1::shared_ptr. This ensures you don’t race with a thread trying to delete an object.
    • All methods are reentrant, thread-safe, and guaranteed not to block on event callbacks (therefore, event callbacks shall not be invoked while holding locks)
    • A total order on locks would need to be specified; for example, the implementation of a method on a control would only be allowed to invoke methods on child controls, except by scheduling an asynchronous callback to run later or on another thread.

    With those two changes, you can apply this to almost any GUI framework you like. There’s not really a need for massive changes; however, the additional locking overhead will slow it down, and the restrictions on lock ordering will make designing custom controls somewhat more complex.

    Since this usually is a lot more trouble than it’s worth, most GUI frameworks strike a middle ground; UI objects can generally only be manipulated from the UI thread (some systems, such as win32, allow there to be multiple UI threads with seperate UI objects), and to communicate between threads there is a threadsafe method to schedule a callback to be invoked on the UI thread.

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

Sidebar

Ask A Question

Stats

  • Questions 147k
  • Answers 147k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You cannot portably treat a non-POD C++ struct/class as a… May 12, 2026 at 9:12 am
  • Editorial Team
    Editorial Team added an answer I was using the wrong List in the code hence… May 12, 2026 at 9:12 am
  • Editorial Team
    Editorial Team added an answer Check out imgAreaSelect plugin, it does that exactly. May 12, 2026 at 9:12 am

Related Questions

Are there any best practices (or even standards) to store addresses in a consistent
Is there a simple solution to do the equivalent of Java's comments: <%-- this
I posted an answer to another stackoverflow question which requires some digital logic to
I posted this digital logic diagram as an answer to another stackoverflow question .
What are your thoughts on this? I'm working on integrating some new data that's

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.