[omniORB] Problems with LinuxThreads and X-libs

Steffen Hansen stefh@mip.ou.dk
Mon, 25 May 1998 13:15:56 +0200 (MDT)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---2099146755-246918648-896094956=:10899
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Mon, 25 May 1998, Ole Storm wrote:

> Greetings,
> 
> Last week I posted a question describing some troubles getting omniORB and
> an application using X11 on Linux to work together. A little later I posted
> my own answer to the question; LinuxThreads and the X libraries are not
> compatible - all X libraries need to be recompiled to fix the problem.

If you do all X calls from the main thread, you dont need to rebuild the X
libraries. You only need to modify a few lines in errno.c in linuxthreads.
I have attached a modified errno.c that works.

The next problem is how to wake up the main thread when some thread wants
to update the gui. The main thread (gui thread) should be sleeping on
select() somewhere in the event loop. I know only one way to wake the main
thread: Make the other threads write a byte to a pipe, which can trigger
an event to the main thread. For an example on how this is done with Qt,
see http://www.troll.no/qt-interest/aix7.html#aiy1
 
> Clearly, this solves my problem - locally! I believe, however, that this
> problem makes omniORB _almost_ useless on Linux - at least for
> applications  using X. You really can't expect users of a product based on
> omniORB to recompile the X libraries in order to use the product. 
> I think maybe this should be taken into consideration if omniORB is
> planning on going commercial (see the "Support for omniORB" e-mail posted
> Friday).

greetings,
--------------
Steffen Hansen                            
email: stefh@mip.ou.dk, stefh@imada.ou.dk 
URL:   http://www.mip.ou.dk/~stefh        

---2099146755-246918648-896094956=:10899
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="errno.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SGI.3.96.980525131556.10899B@slagelse.mip.ou.dk>
Content-Description: errno.c for linuxthreads

LyogTGludXh0aHJlYWRzIC0gYSBzaW1wbGUgY2xvbmUoKS1iYXNlZCBpbXBs
ZW1lbnRhdGlvbiBvZiBQb3NpeCAgICAgICAgKi8NCi8qIHRocmVhZHMgZm9y
IExpbnV4LiAgICAgICAgICAgICAgIC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