> > Does Fl::lock() get granted in a FCFS manner on Linux?  I=20
> > wonder if I'm getting killed by livelock.
>
> In essence, on linux (and other pthread systems) it is simply a wrapper
> for pthread_mutex_lock() so it will be served in whatever fashion the
> host implementation of pthread_mutex_lock is handled. Fltk is not really
> doing anything fancy here at all.
>
> (In practice, there's a few bits to do with whether you have support for
> recursive mutex's and so forth, but nothing that sounds like it would be
> the root of your problem...)

Okay, I'm 99% certain my problem is livelock stemming from pthread's 
non-assurance of FCFS granting of a mutex.

I wrote a simple mutex class that wraps pthread mutexes, but that assures 
fairness (FCFS).  Then I modified Fl_lock.cxx to use my class rather than 
directly using pthread mutexes.

When I rebuilt FLTK and then my app, it worked like a charm.  The issue of app 
jitteriness entirely went away, and everything was very smooth.

If you ignore whitespace and comments my code probably would add about 100 
lines to FLTK 1.1.x., and applies only to the Linux section of Fl_lock.cxx  
Have I got any prayer at all of successfully getting this code, or some 
reworked version of it, incorporated into FLTK 1.1.x?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to