FLTK logo

Re: [fltk.coredev] RFC: Fl::enable_locks()

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: Fl::enable_locks() Ian MacArthur Apr 19, 2021  
 
On 18 Apr 2021, at 19:35, Ian MacArthur wrote:
> 
> As an alternate (for those with 64-bit intel machines and a gcc-like compiler on a posix-like host, anyway) I offer the attached, which yields the following numbers:
> 
> Lock time   : 43612 (1 iterations)
> Unlock time : 23426 (1 iterations)
> Lock time   : 48 (10 iterations)
> Unlock time : 44 (10 iterations)
> Lock time   : 122 (100 iterations)
> Unlock time : 43 (100 iterations)


Here’s a revised version tweaked to build for either Posix or Win32 hosts (still assuming 64-bit intel and gcc tools though.)
I also tweaked it to take the nominal CPU clock speed (in GHz) as a command line parameter...

Running on Win10 on a, nominally, 2.21GHz CPU, I see:

$ ./mutex_test.exe 2.21
Lock time   : 3152 (1 iterations) -- 1426.24ns
Unlock time : 2542 (1 iterations) -- 1150.23ns
Lock time   : 1859 (10 iterations) -- 841.18ns
Unlock time : 5598 (10 iterations) -- 2533.03ns
Lock time   : 1582 (100 iterations) -- 715.84ns
Unlock time : 1526 (100 iterations) -- 690.50ns

$ ./mutex_test.exe 2.21
Lock time   : 2534 (1 iterations) -- 1146.61ns
Unlock time : 2058 (1 iterations) -- 931.22ns
Lock time   : 1606 (10 iterations) -- 726.70ns
Unlock time : 1527 (10 iterations) -- 690.95ns
Lock time   : 1580 (100 iterations) -- 714.93ns
Unlock time : 1528 (100 iterations) -- 691.40ns


Which suggests that the WIN32 mutex is a good bit slower than the MacOS mutex I was testing before.
(Which, actually, I think I knew, now I think about it...)

This is just for info., really.

Code attached...

-- 
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/8DB9C324-56CF-4FC4-AD5B-495BE006C6CA%40gmail.com.






-- 
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/8DB9C324-56CF-4FC4-AD5B-495BE006C6CA%40gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.