[fpc-devel] Fpsigprocmask

Michael Schnell mschnell at lumino.de
Tue Jan 26 15:40:33 CET 2010


On 01/26/2010 02:47 PM, Marco van de Voort wrote:
> IPC is a class of functions. If futex was a portable concept and would
> become POSIX, it would probably all under the IPC class.
>   

As I see it, Futex already is a portable Posix concept, as the PThread
Library automatically uses it with the pthread_mutex_lock() and
pthread_mutex_unlock() functions. I already used that with programs done
in C). So IMHO it would be appropriate to support them with the IPC
class. I'll take a look at that ASAP.

> Use as portable units as possible, until you have proven that there is
> either something wrong with them, or a measurable performance problem in
> your app.
>   
That is exactly what I'm trying to do right now (with your help :)    ).
>   
>> (2) use the most suited algorithm (thus FUTEX) in the most agreeable way
>> (the one I know is via PThreadLib that AFAIK is done within libc
>>     
> There is also pthreads, but afaik it also mostly contains portable calls.
>   
I'll take a look ASAP.
> If the whole world uses mutexes, except some highspeed devices in the
> kernel, 

Why do you think so ? IMHO the whole world of C programs uses pthreadlib
to do threaded applications and with that they use the pthread_mutex
calls that automatically use FUTEX if same is available (on PCs with a
decent Linux distribution, its always available) Otherwise it
automatically uses some kind of OS-based MUTEX. In the same way
pthreadlib automatically uses NTPL threads if this is available (on PCs
with a decent Linux distribution, its always available) Otherwise it
automatically uses "Linux Threads".

> what are you doing that this is really needed? IMHO you are high on
> a concept, and haven't really researched if you really need it.
>   
In fact right now there is no performance need for me, but as I intend
to publish this as an open source "packet" that anybody who wants this
can easily install in Lazarus and then use it, I of course want to
provide the most decent function, portability and performance possible.

-Michael



More information about the fpc-devel mailing list