Re: XForms: pthreads causing crash...

From: bpm@direct.ca
Date: Wed Apr 09 2003 - 10:22:19 EDT

  • Next message: bpm@direct.ca: "Re: XForms: uploading xforms-1.0.tar.gz to savannah.nongnu.org?"

    # To subscribers of the xforms list from bpm@direct.ca :

    To : Jeff

    Please remove us from your mailing list.

    Thank You !

    ----- Original Message -----
    From: "Jeff Pierce" <wd4nmq@comcast.net>
    To: <xforms@bob.usuhs.mil>
    Sent: Tuesday, April 08, 2003 10:20 PM
    Subject: XForms: pthreads causing crash...

    > # To subscribers of the xforms list from Jeff Pierce <wd4nmq@comcast.net>
    :
    >
    > I have an xforms app that accesses a server to get a users list that is
    > displayed in a browser object.
    >
    > Ok, I have had it working for along time, but while the server is being
    > accessed and the data fed into the browser object, all other objects
    > freeze because of the single threaded design. Ok, lets do the serve
    > access as a thread.
    >
    > Which I do using the pthread library. I test out threaded code in a
    > non-xforms app and it runs fine.
    >
    > But, in the xforms app a weird thing happens.
    >
    > I start the app and press the button to go get the server data. Heres a
    > flow of what the code does.
    > 1. deactivate the browser object to keep users from clicking in it.
    > 2. Change browser object background color to let user know it is
    > updating.
    > 3. Tell the thread to go get the data.
    > 4. At this point the button callback ends and xforms should return to
    > it's event handler ready fo another event.
    > 5. In the thread, after it has downloaded and sorted the data, it puts
    > the data in the browser, changes the background color to normal and
    > activates the browser object.
    >
    > Now here's the problem, sometimes it works perfectly. I hit the update
    > button, the browser color changes and debug messages I have in the
    > thread are printed. I can click on other input objects and the cursor
    > goes there while the server thread is doing it's thing. Just what I
    wanted.
    >
    > But, most of the time, while the server is being accessed the clicked on
    > object does NOT get the cursor, and when the server access completes,
    > the browser data is filled in, etc, the app crashes with this error:
    > X Error of failed request: BadWindow (invalid Window parameter)
    > Major opcode of failed request: 38 (X_QueryPointer)
    > Resource id in failed request: 0x20000d1
    > Serial number of failed request: 173187
    > Current serial number in output stream: 173187
    >
    > Like I said sometimes it works fine, but most of the time I get this
    > failure.
    >
    >
    > --
    > Jeff, wd4nmq
    > wd4nmq@comcast.net
    > http://mywebpages.comcast.net/wd4nmq
    >
    > _________________________________________________
    > 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
    >

    _________________________________________________
    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 : Wed Apr 09 2003 - 10:22:18 EDT