Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #113575 > unrolled thread
| Started by | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| First post | 2023-10-30 08:12 +0100 |
| Last post | 2023-11-05 15:30 +0000 |
| Articles | 20 on this page of 151 — 7 participants |
Back to article view | Back to comp.lang.c++
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 3 of 8 — ← Prev page 1 2 [3] 4 5 6 7 8 Next page →
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2023-11-08 20:33 -0800 |
| Message-ID | <uihnek$21rab$1@dont-email.me> |
| In reply to | #117503 |
On 11/3/2023 2:13 AM, David Brown wrote: > On 02/11/2023 21:12, Chris M. Thomasson wrote: >> On 11/2/2023 8:34 AM, David Brown wrote: >>> On 02/11/2023 15:58, Scott Lurndal wrote: >>>> Bonita Montero <Bonita.Montero@gmail.com> writes: >>>>> Am 01.11.2023 um 20:58 schrieb Chris M. Thomasson: >>>>> >>>>>> The benaphore is a semaphore not a mutex! Fwiw, you can use any >>>>>> semaphore as a binary semaphore for use as a mutex. Got it? >>>>> >>>>> A binary semaphore is also a mutex. >>>> >>>> No. Each is distinct. >>>> >>>> It is correct, however, to say that both provide the same >>>> functionality. >>>> >>> >>> Both provide /similar/ functionality, but not necessarily the same. >>> Different OS's differ in the details, but it is common for mutexes to >>> have priority boosting if a high priority thread is waiting for a >>> mutex currently held by a low priority thread. Such boosting is >>> normally not part of the functionality of a binary semaphore. This >>> makes them very distinctly different on such OS's - a mutex is a >>> lock, a semaphore (binary or otherwise) is a signalling mechanism. >> >> Right. Basically, any thread/process can increment and/or decrement a >> semaphore. This is different than pure mutex logic. Even if the mutex >> uses a semaphore under the covers... >> > > That's a very different issue - though of course it is an equally > important distinction between mutexes and binary semaphores. (And no, a > mutex cannot be implemented using semaphores if the mutex has protection > against priority inversion, and the semaphore does not.) > >>> >>> (I don't know if Windows makes such a distinction - it's not an OS >>> you use when thread or process priority is important. It is >>> certainly common, though not universal, for RTOS's. And while I >>> don't know the details, I'd be surprised if Linux and other *nix's >>> didn't have such a distinction.) >>> >> > Got to get very intimate, like how a mutex is very intimate wrt a condition variable... ;^)
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-02 16:44 +0100 |
| Message-ID | <ui0g47$29990$1@dont-email.me> |
| In reply to | #117492 |
Am 02.11.2023 um 15:58 schrieb Scott Lurndal: > No. Each is distinct. You can initialize a binary semaphore with true and use it as a mutex. And a mutex can be realized without a short path but just with a binary semaphore in the mentioned way.
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <864-117-4973@kylheku.com> |
|---|---|
| Date | 2023-11-02 16:02 +0000 |
| Message-ID | <20231102090052.440@kylheku.com> |
| In reply to | #117495 |
On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 02.11.2023 um 15:58 schrieb Scott Lurndal: > >> No. Each is distinct. > > You can initialize a binary semaphore with true and use it > as a mutex. And a mutex can be realized without a short path > but just with a binary semaphore in the mentioned way. You can use a label, if and goto as a while loop. That doesn't mean if and goto /are/ while. Speaking of which, I have often mused that sempahores are like the go to statement of synchronization---which is ironic, given their inventor. -- 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]
| From | Michael S <already5chosen@yahoo.com> |
|---|---|
| Date | 2023-11-03 16:10 +0200 |
| Message-ID | <20231103161010.0000527b@yahoo.com> |
| In reply to | #117499 |
On Thu, 2 Nov 2023 16:02:04 -0000 (UTC) Kaz Kylheku <864-117-4973@kylheku.com> wrote: > On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: > > Am 02.11.2023 um 15:58 schrieb Scott Lurndal: > > > >> No. Each is distinct. > > > > You can initialize a binary semaphore with true and use it > > as a mutex. And a mutex can be realized without a short path > > but just with a binary semaphore in the mentioned way. > > You can use a label, if and goto as a while loop. > > That doesn't mean if and goto /are/ while. > > Speaking of which, I have often mused that sempahores are like the go > to statement of synchronization---which is ironic, given their > inventor. > IMHO, the word 'mutex' has no exact meaning agreed by all or even majority of Computer Science community.
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2023-11-04 21:05 -0700 |
| Message-ID | <ui74af$3qa1r$1@dont-email.me> |
| In reply to | #117510 |
On 11/3/2023 7:10 AM, Michael S wrote: > On Thu, 2 Nov 2023 16:02:04 -0000 (UTC) > Kaz Kylheku <864-117-4973@kylheku.com> wrote: > >> On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: >>> Am 02.11.2023 um 15:58 schrieb Scott Lurndal: >>> >>>> No. Each is distinct. >>> >>> You can initialize a binary semaphore with true and use it >>> as a mutex. And a mutex can be realized without a short path >>> but just with a binary semaphore in the mentioned way. >> >> You can use a label, if and goto as a while loop. >> >> That doesn't mean if and goto /are/ while. >> >> Speaking of which, I have often mused that sempahores are like the go >> to statement of synchronization---which is ironic, given their >> inventor. >> > > IMHO, the word 'mutex' has no exact meaning agreed by all or even > majority of Computer Science community. > mutual exclusion?
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <864-117-4973@kylheku.com> |
|---|---|
| Date | 2023-11-05 04:23 +0000 |
| Message-ID | <20231104212257.502@kylheku.com> |
| In reply to | #117576 |
On 2023-11-05, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote: > On 11/3/2023 7:10 AM, Michael S wrote: >> On Thu, 2 Nov 2023 16:02:04 -0000 (UTC) >> Kaz Kylheku <864-117-4973@kylheku.com> wrote: >> >>> On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: >>>> Am 02.11.2023 um 15:58 schrieb Scott Lurndal: >>>> >>>>> No. Each is distinct. >>>> >>>> You can initialize a binary semaphore with true and use it >>>> as a mutex. And a mutex can be realized without a short path >>>> but just with a binary semaphore in the mentioned way. >>> >>> You can use a label, if and goto as a while loop. >>> >>> That doesn't mean if and goto /are/ while. >>> >>> Speaking of which, I have often mused that sempahores are like the go >>> to statement of synchronization---which is ironic, given their >>> inventor. >>> >> >> IMHO, the word 'mutex' has no exact meaning agreed by all or even >> majority of Computer Science community. >> > > mutual exclusion? Yeah; you know. I lock it, then somehow cleanly stay out of your way while you unlock. Mutual exclusion! -- 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]
| From | Kaz Kylheku <864-117-4973@kylheku.com> |
|---|---|
| Date | 2023-11-02 15:37 +0000 |
| Message-ID | <20231102083305.904@kylheku.com> |
| In reply to | #117489 |
On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 01.11.2023 um 20:58 schrieb Chris M. Thomasson: > >> The benaphore is a semaphore not a mutex! Fwiw, you can use any >> semaphore as a binary semaphore for use as a mutex. Got it? > > A binary semaphore is also a mutex. A semaphore can be used as a mutex, but it isn't one. Firstly, it doesn't have to be binary to be used as a mutex. A semaphore restricted to binary values can still serve as a mutex for the reason that a mutex is never unlocked multiple times in a correct program. So if we correctly use a semaphore as a mutex, its count should never go over 1, and for that reason, we can get away with using semaphore that only counts from 0 to 1. A semaphore isn't a mutex because it doesn't incorporate the concept of lock ownership. The idea that a semaphore represents a locked state, which has an associated owner, arise purely by the situational convention of how it is applied. A semaphore couldn't provide error checking, such as when a mutex non-owner tries to unlock, or recursive deadlock detection. -- 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]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-02 16:48 +0100 |
| Message-ID | <ui0gbs$29990$3@dont-email.me> |
| In reply to | #117494 |
Am 02.11.2023 um 16:37 schrieb Kaz Kylheku: > Firstly, it doesn't have to be binary to be used as a mutex. No, but when being used as a mutex its actual maximum value is one. > A semaphore isn't a mutex because it doesn't incorporate the concept > of lock ownership. Thats not dependent on actual implementation but how you consider the value of the binary semaphore. If it is false it is owned.
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <864-117-4973@kylheku.com> |
|---|---|
| Date | 2023-11-02 16:00 +0000 |
| Message-ID | <20231102085649.385@kylheku.com> |
| In reply to | #117497 |
On 2023-11-02, Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 02.11.2023 um 16:37 schrieb Kaz Kylheku: > >> Firstly, it doesn't have to be binary to be used as a mutex. > > No, but when being used as a mutex its actual maximum value is one. > >> A semaphore isn't a mutex because it doesn't incorporate the concept >> of lock ownership. > > Thats not dependent on actual implementation but how you consider > the value of the binary semaphore. If it is false it is owned. If it is false, it can be understood as representing a locked state. Locked isn't necessarily owned. The semaphore does not record the ID of an owner. In a correct program, a binary semaphore can represent a lock, yet there can be legitimate situations where a thread which didn't place the lock releases 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]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-02 17:26 +0100 |
| Message-ID | <ui0ijl$29qan$1@dont-email.me> |
| In reply to | #117498 |
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.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2023-11-03 10:15 +0100 |
| Message-ID | <ui2do8$2ngpf$2@dont-email.me> |
| In reply to | #117500 |
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. Only the owner can unlock the mutex again. This is completely different from semaphores, where by design any thread can raise or lower the semaphore.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-03 11:55 +0100 |
| Message-ID | <ui2jik$2of1r$1@dont-email.me> |
| In reply to | #117504 |
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. The mentioned benaphore, which is the basic skeleton for all mutexes, is a good example for that.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2023-11-03 14:41 +0100 |
| Message-ID | <ui2tah$2q17j$1@dont-email.me> |
| In reply to | #117506 |
On 03/11/2023 11:55, Bonita Montero 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. The mentioned benaphore, which is the > basic skeleton for all mutexes, is a good example for that. > You can call that a mutex if you like, but you'd be wrong. You could call it a banana, and you would do no worse. Wikipedia may not be have any particular authority on its definitions, but it explains the difference between mutexes and semaphores quite well: <https://en.wikipedia.org/wiki/Lock_(computer_science)#Mutexes_vs._semaphores> Critical to the point of a mutex is that only the thread that locks it can unlock it. You can look at the notes for C++ semaphores here, which make the distinction clear: <https://en.cppreference.com/w/cpp/thread/counting_semaphore> Documentation for C++ mutexes is here : <https://en.cppreference.com/w/cpp/thread/mutex> <https://en.cppreference.com/w/cpp/thread/mutex/unlock> Or you can read the C++ standards if you prefer. (I find the cppreference pages much easier to follow.) Or you can look up the documentation for Windows mutexes on MS's webpages.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-03 15:22 +0100 |
| Message-ID | <ui2vnl$2qcrs$1@dont-email.me> |
| In reply to | #117508 |
Am 03.11.2023 um 14:41 schrieb David Brown: > On 03/11/2023 11:55, Bonita Montero 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. The mentioned benaphore, which is the >> basic skeleton for all mutexes, is a good example for that. >> > > You can call that a mutex if you like, but you'd be wrong. You could > call it a banana, and you would do no worse. > Wikipedia may not be have any particular authority on its definitions, > but it explains the difference between mutexes and semaphores quite well: > <https://en.wikipedia.org/wiki/Lock_(computer_science)#Mutexes_vs._semaphores> > Critical to the point of a mutex is that only the thread that locks it > can unlock it. > You can look at the notes for C++ semaphores here, which make the > distinction clear: At this point in the thread I was discussion whether a mutex has the notion of an ownership and it mutexes vs. semaphores. > > <https://en.cppreference.com/w/cpp/thread/counting_semaphore> > > Documentation for C++ mutexes is here : > > <https://en.cppreference.com/w/cpp/thread/mutex> > <https://en.cppreference.com/w/cpp/thread/mutex/unlock> > > Or you can read the C++ standards if you prefer. (I find the > cppreference pages much easier to follow.) > > Or you can look up the documentation for Windows mutexes on MS's webpages. >
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2023-11-03 16:35 +0100 |
| Message-ID | <ui340b$2r25r$1@dont-email.me> |
| In reply to | #117511 |
On 03/11/2023 15:22, Bonita Montero wrote: > Am 03.11.2023 um 14:41 schrieb David Brown: >> On 03/11/2023 11:55, Bonita Montero 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. The mentioned benaphore, which is the >>> basic skeleton for all mutexes, is a good example for that. >>> >> >> You can call that a mutex if you like, but you'd be wrong. You could >> call it a banana, and you would do no worse. >> Wikipedia may not be have any particular authority on its definitions, >> but it explains the difference between mutexes and semaphores quite well: >> <https://en.wikipedia.org/wiki/Lock_(computer_science)#Mutexes_vs._semaphores> >> Critical to the point of a mutex is that only the thread that locks it >> can unlock it. >> You can look at the notes for C++ semaphores here, which make the >> distinction clear: > > At this point in the thread I was discussion whether a mutex has the > notion of an ownership and it mutexes vs. semaphores. > 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. A semaphore is not a lock, it is a signalling mechanism - and any thread can signal it up or down. A mutex is a locking mechanism to ensure mutually exclusive access to some resource, and only the owner can release the lock (baring exceptional circumstances, such as a process being killed by the OS). A sort-of mutex where any thread could release the lock would be as useful as a chocolate teapot - as would a semaphore which could only be lowered by the thread that raised it. >> >> <https://en.cppreference.com/w/cpp/thread/counting_semaphore> >> >> Documentation for C++ mutexes is here : >> >> <https://en.cppreference.com/w/cpp/thread/mutex> >> <https://en.cppreference.com/w/cpp/thread/mutex/unlock> >> >> Or you can read the C++ standards if you prefer. (I find the >> cppreference pages much easier to follow.) >> >> Or you can look up the documentation for Windows mutexes on MS's >> webpages. >> >
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-03 16:49 +0100 |
| Message-ID | <ui34r0$2r7cc$1@dont-email.me> |
| In reply to | #117514 |
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. 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]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2023-11-03 18:02 +0100 |
| Message-ID | <ui393f$2s0sv$1@dont-email.me> |
| In reply to | #117515 |
On 03/11/2023 16:49, 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. Otherwise you > can easily unlock a mutex which was locked in another thread. > Please read <https://en.cppreference.com/w/cpp/thread/mutex/unlock>. Note the sentence "The mutex must be locked by the current thread of execution, otherwise, the behavior is undefined." Please read the C++ standards, section [thread.mutex.requirements.mutex] and note that for "unlock()", there is the sentence "Preconditions: The calling thread owns the mutex." Please learn what "undefined behaviour" means, and what "preconditions" mean. Then come back and apologise. >> 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. > Using a semaphore as a lock is not recommended because a semaphore does not make a good lock. A main reason for that is that it has no concept of ownership. /All/ locking and inter-thread signalling mechanisms rely on kernel facilities, because they need to be able to sleep, and to wake sleeping threads.
[toc] | [prev] | [next] | [standalone]
| From | Bonita Montero <Bonita.Montero@gmail.com> |
|---|---|
| Date | 2023-11-03 18:08 +0100 |
| Message-ID | <ui39dr$2s28j$1@dont-email.me> |
| In reply to | #117517 |
Am 03.11.2023 um 18:02 schrieb David Brown: > Please read <https://en.cppreference.com/w/cpp/thread/mutex/unlock>. > Note the sentence "The mutex must be locked by the current thread of > execution, otherwise, the behavior is undefined." Maybe, but I'm talking about how mutexes usually work internally. > Using a semaphore as a lock is not recommended because a semaphore does > not make a good lock. A main reason for that is that it has no concept > of ownership. ... Mutexes also usually have no notion of ownership.
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <864-117-4973@kylheku.com> |
|---|---|
| Date | 2023-11-03 17:29 +0000 |
| Message-ID | <20231103102914.506@kylheku.com> |
| In reply to | #117519 |
On 2023-11-03, Bonita Montero <Bonita.Montero@gmail.com> wrote: > Am 03.11.2023 um 18:02 schrieb David Brown: > >> Please read <https://en.cppreference.com/w/cpp/thread/mutex/unlock>. >> Note the sentence "The mutex must be locked by the current thread of >> execution, otherwise, the behavior is undefined." > > Maybe, but I'm talking about how mutexes usually work internally. "Never mind that a[i++] = i is undefined; I'm talking about how it works internally, damn 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]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2023-11-03 18:52 +0000 |
| Message-ID | <3kb1N.177701$sxoa.81181@fx13.iad> |
| In reply to | #117519 |
Bonita Montero <Bonita.Montero@gmail.com> writes: >Am 03.11.2023 um 18:02 schrieb David Brown: > >> Please read <https://en.cppreference.com/w/cpp/thread/mutex/unlock>. >> Note the sentence "The mutex must be locked by the current thread of >> execution, otherwise, the behavior is undefined." > >Maybe, but I'm talking about how mutexes usually work internally. Why does that matter? It's the behavior seen by the code using the mutex that matters. Undefined behavior isn't something an application can rely on. You keep digging yourself deeper and deeper.
[toc] | [prev] | [next] | [standalone]
Page 3 of 8 — ← Prev page 1 2 [3] 4 5 6 7 8 Next page →
Back to top | Article view | comp.lang.c++
csiph-web