XForms: xforms and threads

From: eddie (eddie@brandeis.edu)
Date: Tue May 27 2003 - 14:51:25 EDT

  • Next message: Nicolas Castagné: "Re: XForms: xforms and threads"

    # To subscribers of the xforms list from eddie <eddie@brandeis.edu> :

    I have an application which was running for quite some time without
    calling XInitThreads, until under high load I would get the Xlib async
    error, which after some research, I found had to do with threads.

    So I added XInitThreads() before I create the thread that runs this
    entire application, but now the program, without the application
    actually beginning to send data to these forms, 'hangs' at the main loop:

    do {
    FLOBJECT* obj = fl_check_forms();
    usleep(80000);
    } while (obj != _quitBut && _stop != 1);

    gdb shows it stuck inside fl_check_forms: here is a backtrace:
    gdb) where
    #0 0x40706568 in sigsuspend () from /lib/i686/libc.so.6
    #1 0x40025478 in __pthread_wait_for_restart_signal () from
    /lib/i686/libpthread.so.0
    #2 0x40026e40 in __pthread_alt_lock () from /lib/i686/libpthread.so.0
    #3 0x40023d07 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
    #4 0x40571d2a in _XUnregisterFilter () from /usr/X11R6/lib/libX11.so.6
    #5 0x4054b28c in XQueryExtension () from /usr/X11R6/lib/libX11.so.6
    #6 0x4054190b in XInitExtension () from /usr/X11R6/lib/libX11.so.6
    #7 0x405820c8 in XkbUseExtension () from /usr/X11R6/lib/libX11.so.6
    #8 0x40579675 in XRefreshKeyboardMapping () from /usr/X11R6/lib/libX11.so.6
    #9 0x40578f19 in XkbLookupKeySym () from /usr/X11R6/lib/libX11.so.6
    #10 0x40579b36 in XLookupString () from /usr/X11R6/lib/libX11.so.6
    #11 0x59a79a1e in _XimLocalFilter () from
    /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
    #12 0x405715c5 in XFilterEvent () from /usr/X11R6/lib/libX11.so.6
    #13 0x404aca00 in fl_adjust_form_size () from /usr/X11R6/lib/libforms.so.1
    #14 0x404b0d1c in fl_restore_target () from /usr/X11R6/lib/libforms.so.1
    #15 0x404afbf6 in fl_restore_target () from /usr/X11R6/lib/libforms.so.1
    #16 0x404ae01c in fl_check_forms () from /usr/X11R6/lib/libforms.so.1

    Removing the XInitThreads() obviously doesn't show this -- is there a
    reason why? Do I have a mistake in my event processing loop?

    BTW, the application opens a bunch of FL_NORMAL_BROWSER objects that
    display data. Sometimes we are really rapidly adding lines and changing
    lines into each of these browsers.

    Thank you,
      - Eddie

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/
    Development: http://savannah.nongnu.org/files/?group=xforms



    This archive was generated by hypermail 2b29 : Tue May 27 2003 - 14:55:44 EDT