I only have experience with gtk+ so I'm no authority, but. All gui
libraries that I know are not made to be thread safe, but should be called
from the same thread it was initialized from. This works well if you
instruct users about it properly because in most languages you control
threads explicitly and you know how to synchronize between them. In gtk+
(and I see something similar in the go qml bindings) you usually install a
callback which is called when the gui main loop gets idle. The callback is
executed in the context of the main loop.

The thing with go is that threads can be created all the time and you don't
even know it. go routines are such an integral part of the language, that I
as a user would expected that gui libraries take care of allowing me to
call their code from multiple go routines. You can
check https://github.com/niemeyer/qml to see how you can do that in a
relatively nice way without locking all the time.
On Sunday, November 17, 2013 12:06:19 AM UTC+1, Rob Thornton wrote:

I know of its use in a few games. It would be natural for game related
events and drawing to the screen to be handled separately in a goroutine
and input in another.

Amusingly, the closest date I could find for the initial release of curses
was "around 1980" which makes me only slightly older than the library. ;)
On Saturday, 16 November 2013 14:49:54 UTC-8, RickyS wrote:

What could you do concurrently or in parallel, since the codebase is
still 'single-threaded'?
That is, could curses start prompting the user for input while it draws
the screen? Or something?
I would guess there is nothing you could do that was correct and reliable.
In my memory the old thing would have to wait until the i/o was done,

Perhaps you could reject any call that was not from the starting thread?
I guess the best is provide help for item 2).

Are there startups basing their product on ncurses?
It was designed originally for the vt100, hardware from 30 years ago.
The software is older than you (probably) are.
Best of luck.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 6 | next ›
Discussion Overview
groupgolang-nuts @
postedNov 16, '13 at 10:34p
activeNov 20, '13 at 4:09p



site design / logo © 2022 Grokbase