- Cloud cuckoo land? - 3 Updates
- transactional memory idea - 6 Updates
- C++ preprocessor and multi-line string literals - 3 Updates
- C++ variable names - 3 Updates
woodbrian77@gmail.com: Jan 16 06:41PM -0800 On Thursday, January 16, 2020 at 12:31:12 PM UTC-6, Mr Flibble wrote: > The Services are the way things have to be now. Don't swear here, please. Brian Ebenezer Enterprises https://github.com/Ebenezer-group/onwards |
Christian Gollwitzer <auriocus@gmx.de>: Jan 17 07:51AM +0100 Am 15.01.20 um 23:09 schrieb Daniel: >> my on-line code generator: >> https://github.com/Ebenezer-group/onwards > Is anyone using this? Nobody is raising issues. In addition, most of the commits seem to be rather obscure. The latest commit messages are: Tweaks to ambassador (4x) Tweaks Tweaks to ambassador (4x) Changes to lib Changes to library Tweaks to library ... Many of these commits are 1-line or 2-line changes where a variable name is changed or the like. For a potential collaborator, it is totally unclear why something was changed, and the large number of 600 commits seemingly indicating an active project reduces to only a handful useful commits. Christian |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jan 17 10:24PM > On Thursday, January 16, 2020 at 12:31:12 PM UTC-6, Mr Flibble wrote: >> The > Services are the way things have to be now. Services, yes, your particular service, no. > Don't swear here, please. Your bigotry, spammer, is far more egregious than any swear word I can come up with. Now fuck off you homophobic, sexist cockwomble. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 17 09:10AM +0100 I just had a little idea to abstract intel TSX from the code within a transaction: template<typename L> inline bool transaction( L &lambda ) { if( _xbegin() == _XBEGIN_STARTED ) { lambda(); _xend(); return true; } else return false; } auto syncedOp = [...]( ... ) { ... }; while( !transaction<decltype(syncedOp)>( syncedOp ) ); Intel has TSX and IBM has something similar with the POWER-CPUs so that this could be identically abstracted. And CPUs not having something like this could have a #ifdef code -path in transaction<>() that uses usual locking on a static mutex inside transaction<>() and return true in every case. Another issue: why do I have to write decltype(syncedOp) or why is C++ too stupid to deduce the lambda-type itself. If it could I could write the lambda directly in the function-call. |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 17 02:40PM +0100 Am 17.01.2020 um 09:10 schrieb Bonita Montero: > else > return false; > } This should be better: template<typename L> inline int transaction( L &lambda ) { unsinged code = _xbegin(); if( code == _XBEGIN_STARTED ) { lambda(); _xend(); return 1; } else return code & _XABORT_RETRY ? 0 : -1; } |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jan 17 08:31PM +0100 On 17.01.2020 14:40, Bonita Montero wrote: >> else >> return false; >> } Don't pass the lambda by reference to non-`const`, because that requires the caller to have a lambda /variable/. Use RAII (destructor) to ensure that `_xend()` is called even if the lambda throws an exception. If you don't care to define small RAII classes all over the place, consider using a general one such as gsl::action, <url: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c30-define-a-destructor-if-a-class-needs-an-explicit-action-at-object-destruction> > else > return code & _XABORT_RETRY ? 0 : -1; > } It seems unlikely that the above could be a callback function with a signature required by third party code that you don't control. So, don't use `int` where `bool` (or better, a less conversion-eager wrapper of `bool`) is more appropriate. Example of a `bool` wrapper: <url: https://github.com/alf-p-steinbach/cppx-core-language/blob/master/source/cppx-core-language/types/Truth.hpp> Don't use a choice operator or conditional expression to compute a boolean value when you can directly use a boolean expression. Just my 2c, - Alf |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 17 08:51PM +0100 >>> } > Don't pass the lambda by reference to non-`const`, because that requires > the caller to have a lambda /variable/. Why should this be a problem ? > Use RAII (destructor) to ensure that `_xend()` is called even if the > lambda throws an exception. In an transaction you wouldn't do some RAII-ish things anyway but just simple things like some pointer-adjustments in a data-strcuture. Having fully RAII-conformance might grow the transaction working-set too large. > wrapper of `bool`) is more appropriate. > Don't use a choice operator or conditional expression to compute > a boolean value when you can directly use a boolean expression. There are three states: transaction successful, transaction aborted but could be restarted and transaction aborted and can't be restarted due to cache-overflow (the l1 couldn't track the whole transaction). How should I do that with a bool which can hold two states ? |
Bonita Montero <Bonita.Montero@gmail.com>: Jan 17 08:53PM +0100 > Example of a `bool` wrapper: <url: > https://github.com/alf-p-steinbach/cppx-core-language/blob/master/source/cppx-core-language/types/Truth.hpp> Ultimatively stupid stuff. If you don't like implicit conversion in C++ chose another language. |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jan 17 09:36PM +0100 On 17.01.2020 20:51, Bonita Montero wrote: >> Don't pass the lambda by reference to non-`const`, because that >> requires the caller to have a lambda /variable/. > Why should this be a problem ? It imposes needless verbosity and bug vectors on the calling code. > just simple things like some pointer-adjustments in a data-strcuture. > Having fully RAII-conformance might grow the transaction working-set > too large. No, there is no connection between the way you do cleanup (unsafely, or as I propose safely) and the transaction working set. > could be restarted and transaction aborted and can't be restarted due to > cache-overflow (the l1 couldn't track the whole transaction). How should > I do that with a bool which can hold two states ? In the same way as your current code which you snipped, which returns either 0 or 1. - Alf |
Manfred <invalid@add.invalid>: Jan 17 01:24AM +0100 On 1/16/20 11:43 PM, Öö Tiib wrote: >> but one step earlier, not three. > Are you suggesting what are the raw string literals should be > re-decided in later steps? No, "what are the raw string literals" is "decided" in step 3, and not in step 1. I suggest you re-read step 1, more carefully. |
"Öö Tiib" <ootiib@hot.ee>: Jan 16 04:38PM -0800 On Friday, 17 January 2020 02:25:04 UTC+2, Manfred wrote: > No, "what are the raw string literals" is "decided" in step 3, and not > in step 1. > I suggest you re-read step 1, more carefully. Maybe I am confused indeed. Can we compose raw string literals using \u0052 <- 'R' in step 1 for later steps? |
Manfred <invalid@add.invalid>: Jan 17 03:27AM +0100 On 1/17/20 1:38 AM, Öö Tiib wrote: >> I suggest you re-read step 1, more carefully. > Maybe I am confused indeed. Can we compose raw string literals > using \u0052 <- 'R' in step 1 for later steps? Step 1 is not about composing raw string literals. Do you mean \u0052"__(Hello World!)__" ? This doesn't seem to work, in fact step 1 talks about conversion of "extended characters", and R is not an extended character. [lex.charset] says that "The universal-character-name construct provides a way to name other characters" than the basic ones. This might be the reason why gcc complains about universal character not allowed in the above. |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 16 03:51PM -0800 On 1/16/2020 4:31 AM, Bonita Montero wrote: >> that time however. ... > My first language was BASIC on my Sinclair ZX Spectrum, then GFA Basic > on my Atari ST. I learned BASIC first as well, back in 1984-85, was born in late 1977. Using the cartridge in my Atari 800XL. I was thinking, what the hell is BASIC!? I was a little kid. Then on Christmas, I received a spiral bound book that thought me the language. LOGO was fun as well. Then I learned Borland C on my Atari ST in a week with |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 16 03:51PM -0800 On 1/16/2020 3:51 PM, Chris M. Thomasson wrote: > Using the cartridge in my Atari 800XL. I was thinking, what the hell is > BASIC!? I was a little kid. Then on Christmas, I received a spiral bound > book that thought me the language. LOGO was fun as well. PILOT was really fun as well. |
Manfred <invalid@add.invalid>: Jan 17 01:31AM +0100 On 1/17/20 12:51 AM, Chris M. Thomasson wrote: > was born in late 1977. Using the cartridge in my Atari 800XL. The Matrix is around us all. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment