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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:48:04+00:00 2026-05-26T13:48:04+00:00

Imagine a cross-platform library that has to create its own windows without relying on

  • 0

Imagine a cross-platform library that has to create its own windows without relying on WinForms/GTK#/WPF/MonoMac/etc (this is OpenTK in case anyone is interested).

Here is the deal: Windows and X11-capable Unices support (or can work with) multiple event loops, one on each thread. This means (a) you can create one window per thread and have them work independently and (b) you can run a WinForms (or GTK#, WPF, …) window on one thread and open an OpenTK window on a different, without interference.

Now, to the best of my – admittedly limited – knowledge, Carbon does not support this. OS events are only delivered to the “main” event loop and all secondary threads run on fumes (that is, ReceiveNextEvent always returns eventLoopTimedOutErr and doesn’t find any events). OpenTK itself can work with this limitation, no problem, but this poses an interesting problem to applications that try to mix OpenTK with a different toolkit (e.g. MonoMac) to present a configuration window.

Two options:

  • abandon the idea as crazy and disallow mixing OpenTK with different toolkits (bad).
  • pick a battle-axe and hack Carbon into submission (good).

Here is were you come in: can you think of any way to make this work? Imagine the following scenario:

  1. Thread #1 (main) runs some initialization code of our own choosing and spawns a second thread (we can modify this freely).
  2. Thread #1 (main) opens a native window and runs a RAEL loop (RunApplicationEventLoop). It goes out of our direct control, although we can still install timers to run our code, if necessary.
  3. Thread #2 (secondary) opens an OpenTK window that promptly hangs (events are only delivered to thread #1 and ReceiveNextEvent gets nothing).

Is it possible to filter events from thread #1 and deliver them to thread #2 as necessary? Could CF somehow help here? Gurus of Mac OS X, please help!

(Programming language doesn’t matter, use anything you are familiar with. I’d prefer a Carbon-based solution but Cocoa would work just fine.)

  • 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-26T13:48:05+00:00Added an answer on May 26, 2026 at 1:48 pm

    Passing the events from one thread to another should work as far as just plain getting the events delivered. The sticky part is that a lot of the UI-related APIs are not thread safe, even though the core Carbon Event handling is. Anything that involves updating controls and drawing should probably be handled back on the main thread. That would require a lot of back-and-forth, and it may not be worthwhile to try to make it work.

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

Sidebar

Related Questions

Imagine I want to draw a pyramid made of triangles. -Should I create a
Imagine you have class A which has code which runs as method M. And
I should confess I do not even own a Mac, I have done Windows
The documentation for postMessage implies that cross-domain messaging is possible. However: // When the
I'm interested in making a cross-platform Facebook, but non-browser based application. Therefor I'd like
Is there a reliable, cross-platform way to do IPC (between two JVMs running on
By default, browsers don't allow cross-site AJAX requests. I understand that a badly envisioned
The Windows console has been Unicode aware for at least a decade and perhaps
I have an excel file that has ~10 columns and 1-20 rows. I need
Imagine an ASP.Net 2.0+ app that uses the built-in role-based security to restrict users

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.