Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #113575 > unrolled thread

Run this under Windows and Linux

Started byBonita Montero <Bonita.Montero@gmail.com>
First post2023-10-30 08:12 +0100
Last post2023-11-05 15:30 +0000
Articles 20 on this page of 151 — 7 participants

Back to article view | Back to comp.lang.c++


Contents

  Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-30 08:12 +0100
    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-30 13:08 -0700
      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-10-31 13:25 +0100
        Re: Run this under Windows and Linux Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-10-31 17:37 +0000
        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-10-31 13:59 -0700
          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-01 13:00 +0100
            Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-01 19:24 +0100
              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-01 19:28 +0100
                Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-01 19:04 +0000
                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-01 20:11 +0100
                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 13:02 -0700
                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 13:36 +0100
                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:13 -0700
                          Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 00:19 -0700
                            Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:13 +0100
                            Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-04 15:53 +0000
                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 16:58 +0100
                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 11:44 -0700
                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-09 01:05 -0800
                          Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-04 16:03 +0000
                            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 11:45 -0700
                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 11:48 -0700
                            Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 19:58 +0100
                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:14 -0700
              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 13:01 -0700
                Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 07:10 +0100
              Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-01 20:50 +0000
                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 14:05 -0700
                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 14:07 -0700
              Re: Run this under Windows and Linux Michael S <already5chosen@yahoo.com> - 2023-11-03 16:04 +0200
                Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 15:24 +0100
                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:14 -0700
            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 12:58 -0700
              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 07:10 +0100
                Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-02 14:58 +0000
                  Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-02 16:34 +0100
                    Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 16:46 +0100
                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 13:12 -0700
                      Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 10:13 +0100
                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:16 -0700
                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-08 20:33 -0800
                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 16:44 +0100
                    Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-02 16:02 +0000
                      Re: Run this under Windows and Linux Michael S <already5chosen@yahoo.com> - 2023-11-03 16:10 +0200
                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 21:05 -0700
                          Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-05 04:23 +0000
                Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-02 15:37 +0000
                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 16:48 +0100
                    Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-02 16:00 +0000
                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-02 17:26 +0100
                        Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 10:15 +0100
                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 11:55 +0100
                            Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 14:41 +0100
                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 15:22 +0100
                                Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 16:35 +0100
                                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 16:49 +0100
                                    Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 18:02 +0100
                                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 18:08 +0100
                                        Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-03 17:29 +0000
                                        Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-03 18:52 +0000
                                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:21 -0700
                                        Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-04 17:22 +0100
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 17:35 +0100
                                            Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-04 17:56 +0100
                                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 18:18 +0100
                                      Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-03 18:51 +0000
                                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:20 -0700
                                    Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-03 17:28 +0000
                                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 18:30 +0100
                                        Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-03 18:03 +0000
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 19:07 +0100
                                            Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 19:08 +0100
                                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:26 -0700
                                        Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-03 18:54 +0000
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 20:25 +0100
                                            Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-03 20:56 +0000
                                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:15 +0100
                                                Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-04 16:05 +0000
                                                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 17:35 +0100
                                                Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-04 18:44 +0000
                                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:19 -0700
                                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:16 +0100
                                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:25 +0100
                                        Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:42 -0700
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-05 05:33 +0100
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-05 05:35 +0100
                                            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 12:11 -0800
                                              Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-05 22:54 +0000
                                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 18:49 -0800
                                                  Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-06 02:58 +0000
                            Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-03 15:32 +0000
                              Re: Run this under Windows and Linux David Brown <david.brown@hesbynett.no> - 2023-11-03 18:05 +0100
                            Re: Run this under Windows and Linux scott@slp53.sl.home (Scott Lurndal) - 2023-11-03 16:53 +0000
                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-03 18:09 +0100
                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:25 -0700
                                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:17 +0100
                                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:44 -0700
                                      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-05 05:36 +0100
                                        Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-05 17:25 +0000
                                          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-05 18:55 +0100
                                            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 12:12 -0800
                                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 12:18 -0800
                                                Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-05 22:55 +0000
                                                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 18:53 -0800
                                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 04:44 +0100
                                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 20:10 -0800
                                                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 05:16 +0100
                                                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-08 20:44 -0800
                                                Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-06 04:22 +0000
                                                  Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 05:37 +0100
                                                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 21:01 -0800
                                                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 21:00 -0800
                                                    Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 09:36 +0100
                                                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-06 12:11 -0800
                                                        Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 23:52 +0100
                                                          Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-07 11:51 -0800
                                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 05:15 +0100
                                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 21:02 -0800
                                                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 21:05 -0800
                                                    Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 09:37 +0100
                                                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-06 12:13 -0800
                                                        Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-06 23:53 +0100
                                                          Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-06 23:00 +0000
                                                            Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-07 05:36 +0100
                                                              Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-07 05:29 +0000
                                                                Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-07 09:38 +0100
                                                                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-07 11:53 -0800
                                                                    Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-09 05:49 +0100
                                                                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-08 20:52 -0800
                                                                        Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-09 05:54 +0100
                                                                          Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-08 20:57 -0800
                                                                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-08 20:45 -0800
                                            Re: Run this under Windows and Linux Kaz Kylheku <864-117-4973@kylheku.com> - 2023-11-05 20:53 +0000
                                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-06 12:13 -0800
                              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:24 -0700
                            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-03 15:18 -0700
                              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:18 +0100
                                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:45 -0700
                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-02 13:18 -0700
          Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-01 13:21 +0100
            Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-01 12:59 -0700
              Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 00:01 -0700
              Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:19 +0100
                Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:53 +0100
                Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:51 -0700
                  Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:53 -0700
                    Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-04 12:54 -0700
                      Re: Run this under Windows and Linux "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-11-05 12:15 -0800
    Re: Run this under Windows and Linux Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-11-03 21:18 +0000
      Re: Run this under Windows and Linux Bonita Montero <Bonita.Montero@gmail.com> - 2023-11-04 10:29 +0100
        Re: Run this under Windows and Linux Branimir Maksimovic <branimir.maksimovic@icloud.com> - 2023-11-05 15:30 +0000

Page 5 of 8 — ← Prev page 1 2 3 4 [5] 6 7 8  Next page →


#117537

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-03 15:19 -0700
Message-ID<ui3rko$2vc30$6@dont-email.me>
In reply to#117515
On 11/3/2023 8:49 AM, Bonita Montero wrote:
> Am 03.11.2023 um 16:35 schrieb David Brown:
> 
>> And using the definitions held by most people involved (including the 
>> C++ standard library, the Windows API, and AFAIK POSIX), mutexes have 
>> ownership and semaphores do not. ...
> 
> Mutexes only have ownership if they're recursive. 

WHAT!!! ? ;^o


Otherwise you
> can easily unlock a mutex which was locked in another thread.
> 
>> A semaphore is not a lock, ...
> 
> It can be used as a lock although it is not recommended because
> a semaphore is usually a pure kernel facility.
> 
> 

[toc] | [prev] | [next] | [standalone]


#117548

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-04 10:16 +0100
Message-ID<ui524s$3a606$3@dont-email.me>
In reply to#117537
Am 03.11.2023 um 23:19 schrieb Chris M. Thomasson:
> On 11/3/2023 8:49 AM, Bonita Montero wrote:
>> Am 03.11.2023 um 16:35 schrieb David Brown:
>>
>>> And using the definitions held by most people involved (including the 
>>> C++ standard library, the Windows API, and AFAIK POSIX), mutexes have 
>>> ownership and semaphores do not. ...
>>
>> Mutexes only have ownership if they're recursive. 
> 
> WHAT!!! ? ;^o

It't the surrounding code that "knows" that it is
an owner, not the mutex itself. A non-recurive mutex
just knows that it is owned, but not by whom.

[toc] | [prev] | [next] | [standalone]


#117552

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-04 10:25 +0100
Message-ID<ui52m2$3a606$7@dont-email.me>
In reply to#117537
Am 03.11.2023 um 23:19 schrieb Chris M. Thomasson:
> On 11/3/2023 8:49 AM, Bonita Montero wrote:
>> Am 03.11.2023 um 16:35 schrieb David Brown:
>>
>>> And using the definitions held by most people involved (including the 
>>> C++ standard library, the Windows API, and AFAIK POSIX), mutexes have 
>>> ownership and semaphores do not. ...
>>
>> Mutexes only have ownership if they're recursive. 
> 
> WHAT!!! ? ;^o

It's not necessary to record ownership of a specific thread for a non
recursive mutex but just _that_ a mutex is ownend, and not by whom.
The benaphore can easily locked in one thread and unlocked in another
thread, although this usually doesn't happen.
It's just the surrounding code that successfully locked a mutex that
"knows" it is the owner.

> Otherwise you
>> can easily unlock a mutex which was locked in another thread.
>>
>>> A semaphore is not a lock, ...
>>
>> It can be used as a lock although it is not recommended because
>> a semaphore is usually a pure kernel facility.
>>
>>
> 

[toc] | [prev] | [next] | [standalone]


#117570

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-04 12:42 -0700
Message-ID<ui66rq$3haup$1@dont-email.me>
In reply to#117552
On 11/4/2023 2:25 AM, Bonita Montero wrote:
> Am 03.11.2023 um 23:19 schrieb Chris M. Thomasson:
>> On 11/3/2023 8:49 AM, Bonita Montero wrote:
>>> Am 03.11.2023 um 16:35 schrieb David Brown:
>>>
>>>> And using the definitions held by most people involved (including 
>>>> the C++ standard library, the Windows API, and AFAIK POSIX), mutexes 
>>>> have ownership and semaphores do not. ...
>>>
>>> Mutexes only have ownership if they're recursive. 
>>
>> WHAT!!! ? ;^o
> 
> It's not necessary to record ownership of a specific thread for a non
> recursive mutex but just _that_ a mutex is ownend, and not by whom.
> The benaphore can easily locked in one thread and unlocked in another
> thread, although this usually doesn't happen.
> It's just the surrounding code that successfully locked a mutex that
> "knows" it is the owner.

The surrounding code is the mutex. It can use a kernel semaphore for 
slow paths. You seem to be radically confused.


> 
>> Otherwise you
>>> can easily unlock a mutex which was locked in another thread.
>>>
>>>> A semaphore is not a lock, ...
>>>
>>> It can be used as a lock although it is not recommended because
>>> a semaphore is usually a pure kernel facility.
>>>
>>>
>>
> 

[toc] | [prev] | [next] | [standalone]


#117578

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-05 05:33 +0100
Message-ID<ui75u7$3qqe2$1@dont-email.me>
In reply to#117570
Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:

> The surrounding code is the mutex. ...

You didn't understand me. The surrounding code that operates
on the guarded data structure isn't the mutex.


[toc] | [prev] | [next] | [standalone]


#117579

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-05 05:35 +0100
Message-ID<ui762c$3qrgt$1@dont-email.me>
In reply to#117570
Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:

> The surrounding code is the mutex. ...

You didn't understand me. The surrounding code that operates
on the guarded data structure isn't the mutex.


[toc] | [prev] | [next] | [standalone]


#117600

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-05 12:11 -0800
Message-ID<ui8stj$4c78$1@dont-email.me>
In reply to#117579
On 11/4/2023 9:35 PM, Bonita Montero wrote:
> Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:
> 
>> The surrounding code is the mutex. ...
> 
> You didn't understand me. The surrounding code that operates
> on the guarded data structure isn't the mutex.

Any semaphore can be used as a binary semaphore, which can in turn be 
used for mutual exclusion. Now, the mutex logic itself can record what 
thread has ownership, ect... This is separate from the semaphore logic. 
Are you sure that you are not misunderstanding me?

A semaphore does not have a concept of ownership. However, a mutex does.

[toc] | [prev] | [next] | [standalone]


#117608

FromKaz Kylheku <864-117-4973@kylheku.com>
Date2023-11-05 22:54 +0000
Message-ID<20231105144458.539@kylheku.com>
In reply to#117600
On 2023-11-05, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> On 11/4/2023 9:35 PM, Bonita Montero wrote:
>> Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:
>> 
>>> The surrounding code is the mutex. ...
>> 
>> You didn't understand me. The surrounding code that operates
>> on the guarded data structure isn't the mutex.
>
> Any semaphore can be used as a binary semaphore, which can in turn be 
> used for mutual exclusion. Now, the mutex logic itself can record what 
> thread has ownership, ect... This is separate from the semaphore logic. 
> Are you sure that you are not misunderstanding me?

It's like someone paid to misunderstand ... only minus any actual money.

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

[toc] | [prev] | [next] | [standalone]


#117610

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-05 18:49 -0800
Message-ID<ui9k80$7a3q$1@dont-email.me>
In reply to#117608
On 11/5/2023 2:54 PM, Kaz Kylheku wrote:
> On 2023-11-05, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
>> On 11/4/2023 9:35 PM, Bonita Montero wrote:
>>> Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:
>>>
>>>> The surrounding code is the mutex. ...
>>>
>>> You didn't understand me. The surrounding code that operates
>>> on the guarded data structure isn't the mutex.
>>
>> Any semaphore can be used as a binary semaphore, which can in turn be
>> used for mutual exclusion. Now, the mutex logic itself can record what
>> thread has ownership, ect... This is separate from the semaphore logic.
>> Are you sure that you are not misunderstanding me?
> 
> It's like someone paid to misunderstand ... only minus any actual money.
> 

Humm... Interesting comment! Almost hard to disagree with wrt the, Bontia...

[toc] | [prev] | [next] | [standalone]


#117612

FromKaz Kylheku <864-117-4973@kylheku.com>
Date2023-11-06 02:58 +0000
Message-ID<20231105185312.670@kylheku.com>
In reply to#117610
On 2023-11-06, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
> On 11/5/2023 2:54 PM, Kaz Kylheku wrote:
>> On 2023-11-05, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:
>>> On 11/4/2023 9:35 PM, Bonita Montero wrote:
>>>> Am 04.11.2023 um 20:42 schrieb Chris M. Thomasson:
>>>>
>>>>> The surrounding code is the mutex. ...
>>>>
>>>> You didn't understand me. The surrounding code that operates
>>>> on the guarded data structure isn't the mutex.
>>>
>>> Any semaphore can be used as a binary semaphore, which can in turn be
>>> used for mutual exclusion. Now, the mutex logic itself can record what
>>> thread has ownership, ect... This is separate from the semaphore logic.
>>> Are you sure that you are not misunderstanding me?
>> 
>> It's like someone paid to misunderstand ... only minus any actual money.
>
> Humm... Interesting comment! Almost hard to disagree with wrt the, Bontia...

It's a variation on a quote from Upton Sinclair, evidently found in
_I, Candidate for Governor: And How I Got Licked_ [1935]

"It is difficult to get a man to understand something when his salary
depends on his not understanding it."

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

[toc] | [prev] | [next] | [standalone]


#117513

FromKaz Kylheku <864-117-4973@kylheku.com>
Date2023-11-03 15:32 +0000
Message-ID<20231103082409.123@kylheku.com>
In reply to#117506
On 2023-11-03, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 03.11.2023 um 10:15 schrieb David Brown:
>> On 02/11/2023 17:26, Bonita Montero wrote:
>>> Am 02.11.2023 um 17:00 schrieb Kaz Kylheku:
>>>
>>>> Locked isn't necessarily owned.
>>>> The semaphore does not record the ID of an owner.
>>>
>>> A non-recursive mutes also doesn't do this. The surrounding
>>> code itself is designed in a way that it behaves like an owner.
>> 
>> Mutexes - recursive or non-recursive - /do/ record their owner when the 
>> lock is taken. ...
>
> Absolutely not. You can take ownership of a mutex in one thread and
> release it in another thread.

Not POSIX mutexes: pthread_mutex_unlock by a non-owner is either
undefined behavior, or a condition diagnosed by an error return value,
depending on the mutex attributes:

See the table here:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html

E.g. for a norma mutex type which is not attributed as robust,
it is undefined behavior.

Support for unlocking by a non-owner is possible in a mutex, but that's
a non-mutex-like behavioral extension.

A mutex that is owned by a process, rather than a thread, can be locked
by one thread and unlocked by another. Classic POSIX file locks (F_SETLK
code of fcntl, etc) are like this, IIRC. That's still mutex-like, just
the scope is process, rather than thread.

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

[toc] | [prev] | [next] | [standalone]


#117518

FromDavid Brown <david.brown@hesbynett.no>
Date2023-11-03 18:05 +0100
Message-ID<ui399g$2s0sv$2@dont-email.me>
In reply to#117513
On 03/11/2023 16:32, Kaz Kylheku wrote:
> On 2023-11-03, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>> Am 03.11.2023 um 10:15 schrieb David Brown:
>>> On 02/11/2023 17:26, Bonita Montero wrote:
>>>> Am 02.11.2023 um 17:00 schrieb Kaz Kylheku:
>>>>
>>>>> Locked isn't necessarily owned.
>>>>> The semaphore does not record the ID of an owner.
>>>>
>>>> A non-recursive mutes also doesn't do this. The surrounding
>>>> code itself is designed in a way that it behaves like an owner.
>>>
>>> Mutexes - recursive or non-recursive - /do/ record their owner when the
>>> lock is taken. ...
>>
>> Absolutely not. You can take ownership of a mutex in one thread and
>> release it in another thread.
> 
> Not POSIX mutexes: pthread_mutex_unlock by a non-owner is either
> undefined behavior, or a condition diagnosed by an error return value,
> depending on the mutex attributes:
> 
> See the table here:
> 
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html
> 
> E.g. for a norma mutex type which is not attributed as robust,
> it is undefined behavior.
> 
> Support for unlocking by a non-owner is possible in a mutex, but that's
> a non-mutex-like behavioral extension.
> 
> A mutex that is owned by a process, rather than a thread, can be locked
> by one thread and unlocked by another. Classic POSIX file locks (F_SETLK
> code of fcntl, etc) are like this, IIRC. That's still mutex-like, just
> the scope is process, rather than thread.
> 

Mutexes are locks, but not all locks are mutexes.  File locks are not 
mutexes - they are for controlling access to files, and it might 
(rarely) make sense to unlock them from a different thread than the 
locking thread.

[toc] | [prev] | [next] | [standalone]


#117516

Fromscott@slp53.sl.home (Scott Lurndal)
Date2023-11-03 16:53 +0000
Message-ID<kA91N.279085$8fO.263728@fx15.iad>
In reply to#117506
Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 03.11.2023 um 10:15 schrieb David Brown:
>> On 02/11/2023 17:26, Bonita Montero wrote:
>>> Am 02.11.2023 um 17:00 schrieb Kaz Kylheku:
>>>
>>>> Locked isn't necessarily owned.
>>>> The semaphore does not record the ID of an owner.
>>>
>>> A non-recursive mutes also doesn't do this. The surrounding
>>> code itself is designed in a way that it behaves like an owner.
>> 
>> Mutexes - recursive or non-recursive - /do/ record their owner when the 
>> lock is taken. ...
>
>Absolutely not. You can take ownership of a mutex in one thread and
>release it in another thread. 

That has to be the worst idea you've proposed so far.

[toc] | [prev] | [next] | [standalone]


#117520

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-03 18:09 +0100
Message-ID<ui39gf$2s28j$2@dont-email.me>
In reply to#117516
Am 03.11.2023 um 17:53 schrieb Scott Lurndal:
> Bonita Montero <Bonita.Montero@gmail.com> writes:
>> Am 03.11.2023 um 10:15 schrieb David Brown:
>>> On 02/11/2023 17:26, Bonita Montero wrote:
>>>> Am 02.11.2023 um 17:00 schrieb Kaz Kylheku:
>>>>
>>>>> Locked isn't necessarily owned.
>>>>> The semaphore does not record the ID of an owner.
>>>>
>>>> A non-recursive mutes also doesn't do this. The surrounding
>>>> code itself is designed in a way that it behaves like an owner.
>>>
>>> Mutexes - recursive or non-recursive - /do/ record their owner when the
>>> lock is taken. ...
>>
>> Absolutely not. You can take ownership of a mutex in one thread and
>> release it in another thread.
> 
> That has to be the worst idea you've proposed so far.

I won't say that this is recommendable but just that it is possible
from the way how a mutex usually works. I just wanted to say with
that that mutexes usually have no ownership. You can see that with
the benapohre.

[toc] | [prev] | [next] | [standalone]


#117541

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-03 15:25 -0700
Message-ID<ui3s05$2vc30$10@dont-email.me>
In reply to#117520
On 11/3/2023 10:09 AM, Bonita Montero wrote:
> Am 03.11.2023 um 17:53 schrieb Scott Lurndal:
>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>> Am 03.11.2023 um 10:15 schrieb David Brown:
>>>> On 02/11/2023 17:26, Bonita Montero wrote:
>>>>> Am 02.11.2023 um 17:00 schrieb Kaz Kylheku:
>>>>>
>>>>>> Locked isn't necessarily owned.
>>>>>> The semaphore does not record the ID of an owner.
>>>>>
>>>>> A non-recursive mutes also doesn't do this. The surrounding
>>>>> code itself is designed in a way that it behaves like an owner.
>>>>
>>>> Mutexes - recursive or non-recursive - /do/ record their owner when the
>>>> lock is taken. ...
>>>
>>> Absolutely not. You can take ownership of a mutex in one thread and
>>> release it in another thread.
>>
>> That has to be the worst idea you've proposed so far.
> 
> I won't say that this is recommendable but just that it is possible
> from the way how a mutex usually works. I just wanted to say with
> that that mutexes usually have no ownership. You can see that with
> the benapohre.
> 

Oh shit. You have dug yourself into a really deep hole here, Bonita.

wow.

[toc] | [prev] | [next] | [standalone]


#117549

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-04 10:17 +0100
Message-ID<ui526u$3a606$4@dont-email.me>
In reply to#117541
Am 03.11.2023 um 23:25 schrieb Chris M. Thomasson:

> On 11/3/2023 10:09 AM, Bonita Montero wrote:

>> I won't say that this is recommendable but just that it is possible
>> from the way how a mutex usually works. I just wanted to say with
>> that that mutexes usually have no ownership. You can see that with
>> the benapohre.

> Oh shit. You have dug yourself into a really deep hole here, Bonita.

The benaphore does know that it is owned, but not by whom.
Its the surrounding code that knows that it owns the mutex.

[toc] | [prev] | [next] | [standalone]


#117571

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2023-11-04 12:44 -0700
Message-ID<ui66u7$3haup$2@dont-email.me>
In reply to#117549
On 11/4/2023 2:17 AM, Bonita Montero wrote:
> Am 03.11.2023 um 23:25 schrieb Chris M. Thomasson:
> 
>> On 11/3/2023 10:09 AM, Bonita Montero wrote:
> 
>>> I won't say that this is recommendable but just that it is possible
>>> from the way how a mutex usually works. I just wanted to say with
>>> that that mutexes usually have no ownership. You can see that with
>>> the benapohre.
> 
>> Oh shit. You have dug yourself into a really deep hole here, Bonita.
> 
> The benaphore does know that it is owned, but not by whom.
> Its the surrounding code that knows that it owns the mutex.

Oh god. The benaphore is a semaphore. Mutex logic using a semaphore for 
a slow path is different than a semaphore. God damn, man... You are 
confused and/or trolling? Humm...

[toc] | [prev] | [next] | [standalone]


#117580

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-05 05:36 +0100
Message-ID<ui7653$3qrgt$3@dont-email.me>
In reply to#117571
Am 04.11.2023 um 20:44 schrieb Chris M. Thomasson:

> Oh god. The benaphore is a semaphore. ...

It's a mutex; google for "benaphore mutex -semaphore" and you'll
see a lot of people telling the same like me.

[toc] | [prev] | [next] | [standalone]


#117596

FromKaz Kylheku <864-117-4973@kylheku.com>
Date2023-11-05 17:25 +0000
Message-ID<20231105092225.760@kylheku.com>
In reply to#117580
On 2023-11-05, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> google for ... and you'll see a lot of people telling the same
> like me.

Bandwagon Fallacy

https://en.wikipedia.org/wiki/Argumentum_ad_populum

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

[toc] | [prev] | [next] | [standalone]


#117597

FromBonita Montero <Bonita.Montero@gmail.com>
Date2023-11-05 18:55 +0100
Message-ID<ui8ktg$379h$1@raubtier-asyl.eternal-september.org>
In reply to#117596
Am 05.11.2023 um 18:25 schrieb Kaz Kylheku:
> On 2023-11-05, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>> google for ... and you'll see a lot of people telling the same
>> like me.
> 
> Bandwagon Fallacy
> 
> https://en.wikipedia.org/wiki/Argumentum_ad_populum

In most cases experts are right if they agree on a certain fact.

[toc] | [prev] | [next] | [standalone]


Page 5 of 8 — ← Prev page 1 2 3 4 [5] 6 7 8  Next page →

Back to top | Article view | comp.lang.c++


csiph-web