quakeforge/tools/qwaq
Bill Currie bd98d1d9fb [qwaq] Prepare for threading
So far, no threading has been set up, and only window creation and
printing have been updated, but the basics of the design seem to be
sound.

The builtin functions now no longer call ncurses directly: the build
commands and write them to a command buffer.

Commands that have return values (eg, window creation) write their
results to a results buffer that the originating builtin function
reads. Builtin functions that expect a result "poll" the results buffer
for the correct result (marked by the same command). In a single
UI-thread environment, the results should always be in the same order as
the commands, and in a multi-UI-thread environment, things should
(fingers crossed) sort themselves out as ONE of the threads will be the
originator of the next available result.

Strings in commands (eg, for printing) are handled by acquiring a string
id (index into an array of dstring_t) and including the string id in the
written command. The string id is released upon completion of the
command.

Builtin functions write commands, acquire string ids, and read results.

The command processor reads commands, releases string ids, and writes
results.

Since commands, string ids, and results are all in ring buffers, and
assuming there is only one thread running the builtin functions and only
one thread processing commands (there can be only one because ncurses is
not thread-safe), then there should never be any contention on the
buffers. Of course, if there are multiple threads running the builtin
functions, then locking will be required on the builtin function side.
2020-02-29 01:45:33 +09:00
..
.gdbinit why not? 2001-06-27 05:48:25 +00:00
builtins.c Massive whitespace cleanup. 2012-05-22 08:23:22 +09:00
event.h [qwaq] Remove unnecessary fields from mouse events 2020-02-27 21:08:12 +09:00
main.c Create a basic hello world 2020-02-27 01:18:38 +09:00
Makefile.am Create a basic hello world 2020-02-27 01:18:38 +09:00
progs.src.in Add a little test case for accessing types. 2012-11-15 13:40:11 +09:00
qwaq-app.r [qwaq] Prepare for threading 2020-02-29 01:45:33 +09:00
qwaq-bi.c Add a shutdown builtin to qwaq. 2018-08-19 19:44:45 +09:00
qwaq-curses.c [qwaq] Prepare for threading 2020-02-29 01:45:33 +09:00
qwaq.c Improve handling of pr_argc 2020-02-25 17:36:29 +09:00
qwaq.h Initial checkin of the qwaq mini-engine. 2012-07-15 07:39:50 +09:00