Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #3004
| From | jt@toerring.de (Jens Thoms Toerring) |
|---|---|
| Newsgroups | comp.programming |
| Subject | Re: non-UI thread |
| Date | 2013-02-11 23:58 +0000 |
| Organization | Freie Universitaet Berlin |
| Message-ID | <antet5F19iU1@mid.uni-berlin.de> (permalink) |
| References | <ba6a24c8-15a3-4fd5-83d1-5c914cab70e0@googlegroups.com> |
bob <bob@coolfone.comze.com> wrote:
> I've seen a number of systems where you can only modify the user interface
> on a certain thread - the UI thread. Is this the case for just about all UI
> systems?
I don't know what exactly you mean by an "Ui system" - perhaps it
is something like for example the (Unix) Xlib? There you could only
have one process/thread of a program sending requests to the X ser-
ver. If that's the case then, no, not all "UI systems" have that
limitation anymore. by invoking the function XInitThreads() you
can make the Xlib threadsafe and then send requests to the X ser-
ver concurrently from different threads. But keep in mind that not
all libraries based on the Xlib library does support this yet -
they also need to be threadsafe.
> What are some problems that can happen if you change UI stuff on a non-UI
> thread?
IN X it used to result in an X error when different threads sent
requests in an uncoordienated manner that the X server couldn't
deal with. Results could be anything from nothing noticable (ex-
cept some error messages going to stderr) to garbled graphics to
crashes. And, since this all depended on the exact timing, repro-
ducing the prolblem was basically impossible - not the kind of
error you'd like to have to debug;-)
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
non-UI thread bob <bob@coolfone.comze.com> - 2013-02-11 12:35 -0800
Re: non-UI thread jt@toerring.de (Jens Thoms Toerring) - 2013-02-11 23:58 +0000
Re: non-UI thread Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-02-11 17:44 -0800
Re: non-UI thread "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-02-12 10:33 +0100
csiph-web