Re: XForms: More on the subject of threads

From: Rob Fletcher (rpf1@york.ac.uk)
Date: Fri Jun 02 2000 - 11:41:39 EDT

  • Next message: James D. Stegeman: "Re: XForms: widgets"

    # To subscribers of the xforms list from Rob Fletcher <rpf1@york.ac.uk> :

    On Fri, 2 Jun 2000, Steve Lamont wrote:

    <snip>

    missing ";" ... but you all got this eh?

    > while ( 1 ) {
    >
    > struct timeval sleepy_time;
    >
    > /* Give up the CPU for 10 milliseconds */
    >
    > sleepy_time.tv_sec = 0;
    > sleepy_time.tv_usec = 10000

    ------------------------------------^

    > select( 0, NULL, NULL, NULL, &sleepy_time );
    >
    > pthread_mutex_lock( &mutex ); { /* Critial section */
    >
    > fl_check_forms();
    >
    > } pthread_mutex_unlock( &mutex );
    >
    > }
    >
    > return 0;
    >
    > }

    Works just fine on my SGI O2, IRIX 6.5 etc ...

    With of course,

        pthread_setconcurrency( 5 );

    instead of the "Solaris thingamy".

    Neat Steve .... been running fine for a while with no glitches ...
    and consuming negligble cpu too (of course!!!).

    Rob.

    +============================+====================================+
    | Dr R P Fletcher (Rob) | Email R.Fletcher@york.ac.uk |
    | Graphics Coordinator | Phone +44 (0)1904 433816 |
    | Computing Service | Frontdesk +44 (0)1904 433800 |
    | University of York | Fax +44 (0)1904 433740 |
    | YORK YO10 5DD, UK | ICQ UIN 4019164 |
    | URL: www-users.york.ac.uk/~rpf1/ Camera: /~rpf1/robcam.html |
    +=================================================================+

    _________________________________________________
    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/



    This archive was generated by hypermail 2b29 : Fri Jun 02 2000 - 11:46:48 EDT