nanogui: Thread-safety, wrapping globals in structs, RTEMS
Subject:
Re: Thread-safety, wrapping globals in structs, RTEMS
From:
Kaben Nanlohy ####@####.####
Date:
19 Dec 2000 19:20:21 -0000
Message-Id: <Pine.NEB.4.21.0012191105380.17217-100000@kaben.frye.com>
On Mon, 18 Dec 2000, Greg Haerr wrote:
> Trying to think deeply about this, I came up with the following. Making
> Nano-X or Microwindows work fully reentrant (which is essentially
> what you're talking about with state-variables in a per-task structure)
> isn't really the best solution, unless you really are running multiple
> CPUs. That is, with a single CPU, all of this modification ultimately
> just becomes a "programming methodology" rather than an actual
> speed enhancement, since there's only one CPU anyway.
>
> So, I think a better idea isn't to make Microwindows reentrant,
> but, rather, thread-safe. Here, I am assuming that you're not using
> the client/server Nano-X style, since it already works by serializing
> requests read by the socket in the server. (And RTEMS doesn't have
> processes, only tasks). So, in the linked-together version, all we
> really need is a couple of global semaphores and then wrapping
> them around most graphics calls in order to protect the server's
> state. These could be built as macros and left out of a non-threaded
> version. What do you think of doing it this way?
>
I think that this would fix things for me. Thanks.
I'll share when it works.
-- Kaben.