Replies: 3 comments 6 replies
-
I can comment on task-oriented threading, data oriented threading should be
self explanatory.
The main thread, and because of Cocoa restrictions, should run the render
loop.
The render loop should be dumb. You should not be able to run arbitrary
code in the render thread.
The render thread should just render draw lists, essentially.
You can have a second thread that has an input queue for commands that are
more complicated than can be done with a callback.
Since glfwPollEvents must happen in the render thread, all callbacks should
not ever enter the debugger. They can print a backtrace if necessary and
let the render loop continue.
Complex commands should be handled with a callback that places events in
the input queue for the second thread to pick up. All code that can be
compiled or executed at runtime should happen in the second thread or any
other thread but not in the render thread. Commands that change the
structure of a graphical object should enqueue the draw list from the
graphical object to an update queue on the render thread, which are picked
up and processed before the draw list is rendered.
This architecture prevents random code from crashing the app. A secondary
or tertiary thread can enter the debugger without stopping rendering. This
means, with a graphical debugger the error can be handled in the graphics
ui potentially instead of just in emacs, if you so desire.
…On Thu, Sep 1, 2022 at 2:05 PM Kaveh Kardan ***@***.***> wrote:
Suggestions for how best to do threading?
—
Reply to this email directly, view it on GitHub
<#80>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGMMO7GARFGSTNOY5MOTLV4D467ANCNFSM6AAAAAAQCUKY4Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Updated the topic so we can discuss architecture related matters here. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I guess I intended my post about the render thread and the input thread and
tertiary threads to be in the more "concurrency" architecture discussions.
…On Wed, Sep 7, 2022 at 7:05 PM Kaveh Kardan ***@***.***> wrote:
I think this topic is important enough to have its own thread.
—
Reply to this email directly, view it on GitHub
<#80 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGMMJVCFT25WSNV7F74YDV5EUUTANCNFSM6AAAAAAQCUKY4Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Suggestions for how best to do threading?
Beta Was this translation helpful? Give feedback.
All reactions