Monday, June 26, 2023

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

scott@slp53.sl.home (Scott Lurndal): Jun 26 10:41PM

>console/terminal/tty/whatever on which the boot-process outputs its progress
>and I than use to program in. Or with what I should refer to the ones under
>ALT F2...F6.
 
The unix 'tty' command will tell you the name of
the node in /dev that corresponds to your controlling
terminal. That name might be /dev/console for the
device that owns the host keyboard/mouse/graphic card;
normally known as the system console.
 
The name might instead be /dev/ttys0, or /dev/usbtty0, or
/dev/serial/0 for a serial attached device, or may be
/dev/pts/17 for a pseudo-terminal pair (e.g. used by
xterm, gnome terminal and other gui and non-gui
terminal emulators.
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.

Digest for comp.lang.c++@googlegroups.com - 25 updates in 1 topic

Ben Bacarisse <ben.usenet@bsb.me.uk>: Jun 26 12:53AM +0100

> function.
 
> AFAIK, it is available everywhere bash is so your system should already
> have it. Try "man readline".
 
I don't know if it's what's wanted but the rlwrap program is not as well
know as it should be. Essentially it "wraps" any interactive program
with a readline-driven editing, completion and history interface.
 
--
Ben.
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Jun 25 05:10PM -0700

>>perhaps is already part of Linux ...
 
>>If it is (and thats still a big "if"), where can I find it ?
 
> $ man console_ioctl
 
I believe that only applies to the Linux system console (the text-only
interface you typically get by typing Ctrl-Alt-N, where N is a small
integer). I know the OP wrote "console", but I suspect they're looking
for something that works on a terminal emulator.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jun 25 08:18PM -0400

Keith Thompson wrote:
> handles things like arrow key input, but it doesn't give you information
> like "the user just pressed up-arrow". In the past, I've tried and
> failed to find a library that gives access to that kind of information.
 
These codes are terminal-specific but basic things like up-arrww are
more or less standardized in ANSI terminal.
 
Unsure if this is what you were looking for, but works for me:
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#include <readline/readline.h>
 
int
up_callback(int count, int key) {
printf ("the user just pressed up-arrow\n");
return 0;
}
 
int
main(int argc, char *argv[])
{
rl_bind_keyseq ("\\e[A", up_callback);
free(readline("press a button > "));
 
printf("\n");
 
return 0;
}
 
> (The terminfo database gives you the character sequences corresponding
> to the various keys, but I don't think it provides code to detect them
> on input.)
 
HTH
-Pavel
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Jun 25 07:10PM -0700

>> failed to find a library that gives access to that kind of information.
 
> These codes are terminal-specific but basic things like up-arrww are
> more or less standardized in ANSI terminal.
 
These days, yes, mostly. Termcap, terminfo, and [n]curses were
developed when there were a wide variety of terminals (not just
emulators) with incompatible control sequences. Today if you assume
VT100-compatible codes, you can probably get away with it. But there
are still a lot of libraries that support other terminal types.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
"R.Wieser" <address@is.invalid>: Jun 26 08:50AM +0200

Pavel,
 
> On Linux (strictly speaking, on a GNU system) specifically, try readline
> function.
 
The problem with that is that I need the keys at the moment they are pressed
(and released ?), not only after "enter" is pressed.
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 09:21AM +0200

Keith,
 
> I know the OP wrote "console", but I suspect they're looking
> for something that works on a terminal emulator.
 
Nope, not an emulator. As said, "bullseye lite" doesn't have a GUI.
 
As for the difference between a "console" and a "terminal" ? I must say
that its not quite clear (read: confusing) to me , as it seems to be used
interchangably. If you have a good description about the differences
between a "console" and a "terminal" than I would like to hear about it.
 
Simply said, to me a "console" is the text-based interface you get on a
'puter thats executing the commands. A "terminal" is the program you use
to remotely(?) connect to such a console.
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 09:11AM +0200

Ben,
 
> Essentially it "wraps" any interactive program with a
> readline-driven editing, completion and history interface.
 
Thats pretty-much the opposite of what I currently want/need.
 
I'm trying to write something thats interactive - For example, imagine a
list of items you can move thru using the cursor keys and select pressing
the spacebar.
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 08:46AM +0200

Keith,
 
> curses takes over the entire (text / terminal) screen
...
> but as far as I can tell curses is not suitable for, for example,
> detecting the user pressing an arrow key *without* controlling
> the whole screen.
 
That indeed makes it pretty-much unusable for me.
 
> In the past, I've tried and failed to find a library that gives access
> to that kind of information.
 
IOW, it probably doesn't exist and I need to create my own solution for it.
You telling me that saves me a /lot/ of further googeling. Thanks.
 
> (The terminfo database gives you the character sequences corresponding
> to the various keys, but I don't think it provides code to detect them
> on input.)
 
Its something to look at and see if it can be used to do the reverse.
 
Thanks for the info and heads-up.
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 08:56AM +0200

Scott,
 
> $ man console_ioctl
 
Yeah, I found that one too.
 
Correct me if I'm wrong, but that looks like it only works for the local
keyboard and won't be of much use in a remote session ...
 
Regards,
Rudy Wieser
Christian Gollwitzer <auriocus@gmx.de>: Jun 26 09:32AM +0200

Hi Rudy,
 
Am 26.06.23 um 09:11 schrieb R.Wieser: >> Essentially it "wraps" any
interactive program with a
 
> I'm trying to write something thats interactive - For example, imagine a
> list of items you can move thru using the cursor keys and select pressing
> the spacebar.
 
 
Then you might want something even more higher level than curses. For
example, CDK gives you widgets in order to program a GUI that runs in
the terminal: https://github.com/lnkgyv/cdk_examples
 
If you are actually looking to do it on your own, you might want to look
at termcap, which tells you the raw codes involved:
https://www.gnu.org/software/termutils/manual/termcap-1.3/html_node/termcap_37.html
 
Christian
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Jun 26 01:29AM -0700


> Simply said, to me a "console" is the text-based interface you get on a
> 'puter thats executing the commands. A "terminal" is the program you use
> to remotely(?) connect to such a console.
 
The term "console", on Unix-like systems, typically refers to the system
console, sometimes accessed via /dev/console, while a "terminal" is a
more general term for a text-based interface, usually accessed via
/dev/tty* or similar. (A typical user might never see the console.)
 
The details beyond that are probably off-topic here.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Jun 26 01:30AM -0700


> Simply said, to me a "console" is the text-based interface you get on a
> 'puter thats executing the commands. A "terminal" is the program you use
> to remotely(?) connect to such a console.
 
The term "console", on Unix-like systems, typically refers to the system
console, sometimes accessed via /dev/console, while a "terminal" is a
more general term for a text-based interface, usually accessed via
/dev/tty* or similar. (A typical user might never see the console.)
 
Historically, you'd have a single system console (hardware terminal)
connected directly to the computer, and one or more remote terminals for
users. More modern interfaces (virtual consoles and terminal emulators)
are based on that.
 
The details beyond that are probably off-topic here, if they aren't already.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Keith Thompson <Keith.S.Thompson+u@gmail.com>: Jun 26 01:39AM -0700

>> function.
 
> The problem with that is that I need the keys at the moment they are pressed
> (and released ?), not only after "enter" is pressed.
 
You might take a look at the readline source code to see how it does
that. It's certainly able to recognize the user pressing up-arrow
(which typically sends Esc-[-A) and acting on it immediately,
even if it doesn't expose that ability directly to the user.
 
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
wij <wyniijj5@gmail.com>: Jun 26 02:06AM -0700

On Monday, June 26, 2023 at 1:45:54 AM UTC+8, R.Wieser wrote:
> example, catch a ctrl-cursor-left as well as a normal or a shift-curor-left.
 
> Regards,
> Rudy Wieser
 
/* Copyright is licensed by GNU LGPL, see file COPYING. by I.J.Wang 2005
 
Raw mode TTY for keyboard input.
 
Build: g++ t_kb.cpp -lwy
*/
#include <Wy.stdio.h> // for cin,cout,cerr
#include <Wy.termios.h>
#include <Wy.unistd.h>
 
using namespace Wy;
 
// TTY i/o (raw mode terminal)
// RawTerm changes tty attributes so that we can read key stroke without press ENTER
//
// Warning: Many virtual members of ChrFile are not reimplemented for simplicity.
//
class RawTerm : public ChrFile {
Termios m_ptio; // Previous(original) termios setting
public:
WY_DECL_REPLY;
RawTerm() {};
RawTerm(const char*, int);
~RawTerm();
Errno getch(char&);
Errno write(const char);
Errno write(const char*);
} static mtty("/dev/tty",O_RDWR);
 
RawTerm::RawTerm(const char* pathname, int flag)
: ChrFile(pathname,flag)
{
Errno r=tcflush(*this,TCIFLUSH);
if(r!=Ok) {
WY_THROW( Reply(r) );
}
if((r=tcgetattr(*this,m_ptio))!=Ok) {
WY_THROW( Reply(r) );
}
try {
// Set the terminal mode
//
Termios ntio(m_ptio);
ntio.iflag_and(~(BRKINT| ICRNL| IXON| INPCK | ISTRIP));
ntio.lflag_and(~(ICANON| ECHO| ISIG| TOSTOP| IEXTEN));
ntio.oflag_and( ~(OPOST) );
ntio.cflag_or( CS8 );
ntio.cc_VMIN(1);
ntio.cc_VTIME(0);
if((r=tcsetattr(*this,TCSANOW,ntio))!=Ok) {
WY_THROW( Reply(r) );
}
 
// Read back check
Termios tmptio;
if((r=tcgetattr(*this,tmptio))!=Ok) {
WY_THROW( Reply(r) );
}
 
// Omitted: Check termios setting accepted or not
}
catch(const Termios::Reply& e) {
WY_THROW( Reply(r) );
};
};
 
RawTerm::~RawTerm()
{
// If *this is default, these functions just fail (no effect for any device)
Errno r;
r=tcflush(*this,TCIFLUSH);
r=tcsetattr(*this,TCSANOW,m_ptio);
};
 
/ Get one char from terminal
//
Errno RawTerm::getch(char& ch)
{
Errno r;
size_t n;
if((r=ChrFile::read(&ch,sizeof(ch),n))!=Ok) {
WY_RETURN(r);
}
if(n==0) {
WY_RETURN(EIO);
}
return r;
};
Errno RawTerm::write(const char ch)
{
Errno r;
size_t n;
if((r=ChrFile::write(&ch,sizeof(ch),n))!=Ok) {
WY_RETURN(r);
}
if(n!=1) {
WY_RETURN(EIO);
}
return r;
};
Errno RawTerm::write(const char* str)
{
if(str==NULL) {
WY_RETURN(EFAULT);
}
const size_t slen=Wy::strlen(str);
Errno r;
size_t n;
if((r=ChrFile::write(str,slen,n))!=Ok) {
WY_RETURN(r);
}
if(n!=slen) {
WY_RETURN(EIO);
}
return r;
};
int main(int, char* [])
try {
 
Errno r;
 
if((r=mtty.write("中文"))!=Ok) {
WY_THROW(r);
}
for(;;) {
char ch;
if((r=mtty.getch(ch))!=Ok) {
WY_THROW(r);
}
if((ch=='q')||(ch=='Q')) {
break;
}
/* if((r=mtty.write(ch))!=Ok) {
WY_THROW(r);
}*/
cout << (unsigned char)ch << ',';
}
return 0;
}
catch(const Errno& e) {
cerr << wrd(e) << WY_ENDL;
return e.c_errno();
}
catch(...) {
cerr << "main caught(...)" WY_ENDL;
throw;
};
 
----------------------------------
[]$ ./a.out
中文27,91,51,126,27,91,51,59,50,126,27,91,51,59,53,126,27,91,51,59,51,126, // keystroke: del, sh-del, ctrl-del, alt-del
"Fred. Zwarts" <F.Zwarts@HetNet.nl>: Jun 26 12:31PM +0200

Op 26.jun..2023 om 09:21 schreef R.Wieser:
 
> Simply said, to me a "console" is the text-based interface you get on a
> 'puter thats executing the commands. A "terminal" is the program you use
> to remotely(?) connect to such a console.
 
Console for Linux is normally used for the console which uses a keyboard
directly connected to the computer, e.g. with USB, or PS2.
 
A terminal is more generic. E.g., originally terminals where connected
with a serial line to a computer ad the terminal did the interpretation
of the keyboard. This made it impossible to detect certain keypresses,
such as Ctrl, Shift, etc. The terminal in such a case does not send e.g.
a 'Shift' press, an 'a' press, an 'a' release and a 'Shift' release, but
it sends an uppercase 'A'.
Therefore, your request to detect pressing and releasing keys is not
possible for generic terminal software.
"Fred. Zwarts" <F.Zwarts@HetNet.nl>: Jun 26 12:47PM +0200

Op 26.jun..2023 om 12:31 schreef Fred. Zwarts:
> it sends an uppercase 'A'.
> Therefore, your request to detect pressing and releasing keys is not
> possible for generic terminal software.
 
And, of course, with software keyboards on a touch screen, the situation
is again completely different. Generic terminal software hides such
differences, but that limits the possible operations.
"R.Wieser" <address@is.invalid>: Jun 26 01:49PM +0200

Wij,
 
[snip code]
 
Thank you. Looking at the code I'm going to assume that receiving CTRL, ALT
and SHIFT modifier keys too is just a setting added to the "ntio.iflag"
field. I'll just have to check/find out which one it is. :-)
 
Regards,
Rudy Wiesr
"R.Wieser" <address@is.invalid>: Jun 26 01:43PM +0200

Keith,
 
> up-arrow (which typically sends Esc-[-A) and acting on it
> immediately, even if it doesn't expose that ability directly
> to the user.
 
As mentioned in my initial post, I have already switched the console input
to "raw", and as such I can see bytes coming in when I press keys. Thats
not the problem.
 
What is is turning those streams of bytes into individual keystrokes. I can
and already have parsed most keys for the "$TERM=linux" environment, but
would like *NOT* to use my own code if something build-in is available - and
getting support for other $TERM environments for free. :-)
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 01:30PM +0200

Keith,
 
> system console, sometimes accessed via /dev/console, while a "terminal"
> is a more general term for a text-based interface, usually accessed via
> /dev/tty* or similar. (A typical user might never see the console.)
 
As I said, the difference between them is /at best/ confusing. That you
than introduce "system console" without offering any explanation to it does
not help either. :-|
 
 
I found a link which says that all things are terminals, and that a console
is just a special one (your "system console").
 
In that case I'm working on/in the system console.
 
Though I'm going to have a hard time remembering that ALT F1 is a console,
but that ALT F2...F6 are terminals (I probably, likely won't. Too little,
if any, distinction).
 
And it doesn't help that I have a couple of WYSE WY60 terminals standing
behind me. :-)
 
Regards,
Rudy Wieser
"R.Wieser" <address@is.invalid>: Jun 26 01:56PM +0200

Fred,
 
 
> A terminal is more generic. E.g., originally terminals where connected
> with a serial line to a computer ad the terminal did the interpretation of
> the keyboard.
 
Yep, that is how I defined "console" and "terminal" myself too. The first
one part of the computer (in my case, all the ones behind the ALT F1...F6
keys), the second one remote to it (and talking to it using some kind of
serial connection).
 
But as you might have noticed, the definition does seem to differ between
the different people (noticed the same while searching the internet)
 
> Therefore, your request to detect pressing and releasing keys is not
> possible for generic terminal software.
 
I was already "afraid" of that, but it could not hurt to ask. Perhaps times
have changed and being able to capture a key release was added to (some
versions of) Linux.
 
Regards,
Rudy Wieser
Ben Bacarisse <ben.usenet@bsb.me.uk>: Jun 26 01:50PM +0100


>> Essentially it "wraps" any interactive program with a
>> readline-driven editing, completion and history interface.
 
> Thats pretty-much the opposite of what I currently want/need.
 
Good to know. I suspected it was not the right thing but I had not read
every post carefully.
 
> I'm trying to write something thats interactive - For example, imagine a
> list of items you can move thru using the cursor keys and select pressing
> the spacebar.
 
There used to be libraries built on top of curses (and/or ncurses) that
provided higher-level user interaction widgets like this. I can't
remember if any caught on, but it might be worth looking before building
your own.
 
--
Ben.
"R.Wieser" <address@is.invalid>: Jun 26 03:03PM +0200

Ben,
 
> There used to be libraries built on top of curses (and/or ncurses)
> that provided higher-level user interaction widgets like this.
 
I'm not looking for specifically the widgets (the example was just that,
something to be able to relate to), but for how to be able to do something
interactive with the keyboard. And for that I need to be able to extract
keystrokes from the input stream.
 
Regards,
Rudy Wieser
scott@slp53.sl.home (Scott Lurndal): Jun 26 01:58PM

>interface you typically get by typing Ctrl-Alt-N, where N is a small
>integer). I know the OP wrote "console", but I suspect they're looking
>for something that works on a terminal emulator.
 
I thought about that, but "console-based program" pretty much implied
no GUI.
 
With graphics, the toolkit (X11, GDK) provides interfaces to handle
and parse keystrokes.
scott@slp53.sl.home (Scott Lurndal): Jun 26 02:00PM

>console, sometimes accessed via /dev/console, while a "terminal" is a
>more general term for a text-based interface, usually accessed via
>/dev/tty* or similar. (A typical user might never see the console.)
 
Although prior to running unix on PC's, all consoles were serial
terminals (or real teletypes or DECwriters), the only difference
between /dev/console and /dev/tty1
was that they were two different serial ports.
scott@slp53.sl.home (Scott Lurndal): Jun 26 02:02PM


>Yeah, I found that one too.
 
>Correct me if I'm wrong, but that looks like it only works for the local
>keyboard and won't be of much use in a remote session ...
 
There is no way to transmit keystroke metadata over a serial line generally,
so for anything other than the "console" terminal, all you get are ascii
characters.
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.

Thursday, June 22, 2023

Digest for comp.lang.c++@googlegroups.com - 3 updates in 2 topics

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 22 12:56PM -0700

> you need a couple of hours and google to decipher. However even not knowing much
> javascript I can figure out how most of your code works. Thats the sign of
> a good developer IMO.
 
Thanks again; see what you mean, and agree. I want to be able to read
the code without blood shooting out of my eyes! Ouch.
 
 
> freeing the mem yourself (assuming you don't use raw pointers) but OTOH you
> don't have that worry whether your code might almost grind to a halt when the GC
> finally gets its butt into gear.
 
Love RAII. However, a long time ago, I was tasked with a job that
involved improving the performance for a system that used a GC. No way
to ditch the GC, anyway... ;^/ anyway, my improvements that happened to
use a lot of clever manual memory management techniques, took a lot of
pressure off of the GC. It improved performance wrt all of their
existing tests, passed all of them faster...
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 22 02:28PM -0700


>> Read all when you get some time... ;^)
 
> Think I'll write my own version when I get some free time, looks like a fun
> little project!
[...]
 
Fwiw, here are some strange results I got from some of my experiments:
 
https://youtu.be/mqYBMuvVJI8
 
https://youtu.be/abQDYGT_cIk
Jan van den Broek <balglaas@sdf.org>: Jun 22 05:55AM

[f'up-to alt.dev.null set]
 
> Dear Friend,
 
In the headers:
|Organization: Olcott is cock Sucker
 
Looks like someone is masking a personal opinion as spam.
 
--
Jan v/d Broek
balglaas@sdf.org
Look out, here he comes again
The kid with the replaceable head
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.

Tuesday, June 20, 2023

Digest for comp.programming.threads@googlegroups.com - 4 updates in 4 topics

"V õ l u r" <nooneyenoneyouareright@mail.ee>: Jun 19 08:10AM -0700

All nations have the same average I.Q.
"V õ l u r" <nooneyenoneyouareright@mail.ee>: Jun 19 08:09AM -0700

Why does the salesman need to travel ? He can tell the customers to come to his place and buy the stuff from there!
"V õ l u r" <nooneyenoneyouareright@mail.ee>: Jun 19 08:07AM -0700

Are You a computer scientist ?
"V õ l u r" <nooneyenoneyouareright@mail.ee>: Jun 19 08:07AM -0700

We can all know this by ourselves, if we ask god.
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.programming.threads+unsubscribe@googlegroups.com.

Saturday, June 17, 2023

Digest for comp.lang.c++@googlegroups.com - 15 updates in 5 topics

David Brown <david.brown@hesbynett.no>: Jun 17 07:57PM +0200

On 17/06/2023 00:17, Alf P. Steinbach wrote:
>> would be
>> simpler and equally safe.
 
> On that we agree. :)
 
If we knew that the original pointer pointed to a uint64_t, then we
could /all/ agree that a plain assignment would be simpler, clearer, and
as efficient as possible.
 
But as far as I know, no such guarantee exists. My guess, from how
functions like this are sometimes used, is that the original data is in
an array of unsigned char - perhaps a buffer for a received network
packet or a file that has been read.
 
And if the data does not start as a uint64_t (or compatible type), then
reading it through a uint64_t glvalue is /not/ safe, even if alignment
is guaranteed.
 
>> claiming that uint64_t is a character type?
 
> It may be that my English isn't good enough to understand a one-way
> nature of the GCC docs' wording.
 
The "cppreference" site is often clearer than the standards language:
 
<https://en.cppreference.com/w/cpp/language/reinterpret_cast#Type_aliasing>
 
The key point is that a reinterpret_cast (or equivalent via a C-style
cast) does not let you access incompatible types. It does not, in gcc
parlance, side-step the strict aliasing rules.
 
Like a C cast, reinterpret_cast is a way to tell the compiler that you
think it is safe to change the type of an object (usually a pointer).
But it does not /make/ it safe. And if the compiler can see that the
actual object type is not compatible with the way you are accessing it,
then you have a conflict - you are lying to the compiler, and no good
will come of it. A reinterpret_cast will not change that situation.
(And separate compilation will only hide the problem.)
 
 
> value, it can optimize, e.g. not reload that value from memory when it's
> already in a register. If T = float and U* = int*, then it can make this
> assumption. Similarly if T = int and U* = float*, it can assume this.
 
Yes.
 
> But if T = char-type, such as the first char in an array, and U* is a
> double*, then it can not reasonably make this assumption, and as I read
> the docs quote g++ doesn't make this assumption for T = char-type.
 
No. You can use a char-type pointer to access a non-char object, but
you cannot use a non-char pointer to access a char (array) object.
 
I think gcc's documentation could certainly be clearer here, and I also
think that the documentation for "-fstrict-aliasing" flag could be moved
from an optimisation flag to the "code generation options" page. IMHO,
using "-fno-strict-aliasing" is a significant change to the semantics of
the language, making previously undefined behaviour into defined
behaviour (much like "-fwrapv" does for signed integer overflow).
 
> And similarly, if T = double and U* is a char-type*, then it can not
> reasonably make this assumption, and as I read the docs quote g++
> doesn't make this assumption for U* = char-type*.
 
Correct.
 
However, gcc/g++ is not saying anything more or less than the standards
say here. The behaviour - both the defined behaviour, and the undefined
behaviour - comes straight from the standard. (The only exception is
for type-punning unions. C90 did not explicitly say they were allowed,
but the gcc documentation says they are allowed even in C90 mode. C99
onwards allows them, while C++ never has.)
 
Bonita Montero <Bonita.Montero@gmail.com>: Jun 17 08:08PM +0200


> ... The memcpy() would only be reasonable if it were possible
> for "data' to be a misaligned pointer; otherwise simple assignment
> would be simpler and equally safe.
 
I'm aliasing a char-array.
"Alf P. Steinbach" <alf.p.steinbach@gmail.com>: Jun 17 08:37PM +0200

On 2023-06-17 7:57 PM, David Brown wrote:
>> read the docs quote g++ doesn't make this assumption for T = char-type.
 
> No.  You can use a char-type pointer to access a non-char object, but
> you cannot use a non-char pointer to access a char (array) object.
 
Assuming no padding bits, which for clarity is not checked (AFAIK there
is no extant compiler that introduces padding bits):
 
#include <new>
#include <assert.h>
#include <stdio.h>
 
auto main() -> int
{
alignas( int ) char chars[sizeof( int )] = {};
int* const p = std::launder( new( (void*) chars ) int );
assert( *p == 0 );
chars[0] = 42;
printf( "This system is %s-endian.\n", (*p == 42)? "little" :
"big" );
}
 
One possible way to reconcile that working example with your assertion
"cannot" is that in your view the `*p` expressions do not access the
character array but the `double` object that resides there.
 
If that is the case then the assertion is meaningless nonsense,
consistent with your sequence of self-contradictions in this thread.
 
[snip]
 
 
- Alf
David Brown <david.brown@hesbynett.no>: Jun 18 12:30AM +0200

On 17/06/2023 20:37, Alf P. Steinbach wrote:
 
> One possible way to reconcile that working example with your assertion
> "cannot" is that in your view the `*p` expressions do not access the
> character array but the `double` object that resides there.
 
It is an int, in your example, not a double, but otherwise that is
/exactly/ what happens. *p is accessing the int object, not a char array.
 
Then "chars[0] = 42;" is using a character pointer to access the memory
used for storing an int.
 
<https://en.cppreference.com/w/cpp/utility/launder>
 
 
> If that is the case then the assertion is meaningless nonsense,
> consistent with your sequence of self-contradictions in this thread.
 
I haven't contradicted myself - I have only contradicted you.
David Brown <david.brown@hesbynett.no>: Jun 18 12:36AM +0200

On 16/06/2023 19:27, Alf P. Steinbach wrote:
 
> [snip]
 
>> The ball is in your court.
 
> In the above you contradict yourself:
 
Your English is better than most native speakers - but you have to /try/
to read and understand posts. It is your comprehension that is at
fault, and I suspect also your assumptions about C and C++. (To be
fair, many of your assumptions are true in all realistic implementations
in the modern world.)
 
 
> * First you claim that there are no padding bits for `uint64_t`.
 
Correct. That's what the C standard says, and that's what the C++
standard says by delegation to the C standard.
 
> * Then you paraphrase the standard that "there may be padding bits".
 
You asked for references - I gave them. Look them up. You will see
that in general, unsigned integer types (other than unsigned char) may
have padding bits. Only specific types such as the size-specific types
in <stdint.h> are guaranteed not to have padding bits - /if/ they exist.
An implementation might not support these non-padded types at all. It
might support them as extended integer types, and have padding bits in
the standard integer types. It might have lots of unsigned types - some
with padding, some without.
 
But uint64_t and the other size-specific unsigned types are guaranteed
not to have padding.
 
"Alf P. Steinbach" <alf.p.steinbach@gmail.com>: Jun 18 01:11AM +0200

On 2023-06-18 12:30 AM, David Brown wrote:
 
>> If that is the case then the assertion is meaningless nonsense,
>> consistent with your sequence of self-contradictions in this thread.
 
> I haven't contradicted myself - I have only contradicted you.
 
Well I give up, as usual when I encounter strong religious beliefs with
argumentation consisting of self-contradictions, denials and advice.
 
 
- Alf
Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>: Jun 17 03:39PM -0700

I'm currently writing a program that decrypts its own machine code at runtime.
 
The function that writes to the code memory is causing a crash because it's being flagged by Address Sanitizer.
 
I want to have a way to be able to call any function and to have the choice of disabling address sanitiser for that one invocation of the function (but not for other invocations).
 
Here's what I've written:
 
template<typename Lambda>
void NoSanitizeAddress(Lambda &f) __attribute__((__no_sanitize_address__));
 
template<typename Lambda>
void NoSanitizeAddress(Lambda &f)
{
f();
}
 
int main(void)
{
NoSanitizeAddress( [](){ SomeFunction(); } );
}
 
This works fine. I just wonder if there's a better way of doing this though.
olcott <polcott2@gmail.com>: Jun 17 02:23PM -0500

sci.logic Daryl McCullough Jun 25, 2004, 6:30:39 PM
You ask someone (we'll call him "Jack") to give a truthful
yes/no answer to the following question:
 
Will Jack's answer to this question be no?
Jack can't possibly give a correct yes/no answer to the question.
 
When the halting problem is construed as requiring a correct yes/no
answer to a self-contradictory question it cannot be solved.
 
My semantic linguist friends understand that the context of the question
must include who the question is posed to otherwise the same
word-for-word question acquires different semantics.
 
The input D to H is the same as Jack's question posed to Jack, has no
correct answer because within this context the question is
self-contradictory.
 
When we ask someone else what Jack's answer will be or we present a
different TM with input D the same word-for-word question (or bytes of
machine description) acquires entirely different semantics and is no
longer self-contradictory.
 
When we construe the halting problem as determining whether or not an
(a) Input D will halt on its input <or>
(b) Either D will not halt or D has a pathological relationship with H
 
Then this halting problem cannot be showed to be unsolvable by any of
the conventional halting problem proofs.
 
 
The x86utm operating system
(includes several termination analyzers)
https://github.com/plolcott/x86utm
 
--
Copyright 2023 Olcott "Talent hits a target no one else can hit; Genius
hits a target no one else can see." Arthur Schopenhauer
Bonita Montero <Bonita.Montero@gmail.com>: Jun 17 06:22PM +0200

I wanted to test how many time it takes for a thread to signal
a semaphore to another thread and to wait to be signalled back.
That's essential for mutexes when they're contended. I tested
this under Windows 11 with a Ryzen 9 7950X system.
I tested different combinations of logical cores. The first
thread is always fixed on the first core and the other thread
is varying. I print the X2 APIC ID along with the result.
The fastest result I get is about 20.000 clock cycles for one
switch to the other thread. I think that's enormous.
A similar benchmark written for linux using Posix semapohres
gives about 8.000 clock cylces per switch on a 3990X system.
That's a huge difference since the CPU is a Zen2-CPU with a
much lower clock rate than the 7950X Zen4 system.
 
#include <Windows.h>
#include <iostream>
#include <thread>
#include <system_error>
#include <chrono>
#include <latch>
#include <charconv>
#include <intrin.h>
 
using namespace std;
using namespace chrono;
 
int main( int argc, char **argv )
{
static auto errTerm = []( bool succ, char const *what )
{
if( succ )
return;
cerr << what << endl;
terminate();
};
int regs[4];
__cpuid( regs, 0 );
errTerm( (unsigned)regs[0] >= 0xB, "max CPUID below 0xB" );
bool fPrio = SetPriorityClass( GetCurrentProcess(),
REALTIME_PRIORITY_CLASS )
|| SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS );
errTerm( fPrio, "can't set process priority class" );
unsigned nCPUs = jthread::hardware_concurrency();
for( unsigned cpuB = 1; cpuB != nCPUs; ++cpuB )
{
auto init = []( HANDLE &hSem, bool set )
{
hSem = CreateSemaphoreA( nullptr, set, 1, nullptr );
errTerm( hSem, "can't create semaphore" );
};
HANDLE hSemA, hSemB;
init( hSemA, false );
init( hSemB, true );
atomic_int64_t tSum( 0 );
latch latRun( 3 );
auto flipThread = [&]( HANDLE hSemMe, HANDLE hSemYou, size_t n,
uint32_t *pX2ApicId )
{
latRun.arrive_and_wait();
auto start = high_resolution_clock::now();
for( ; n--; )
errTerm( WaitForSingleObject( hSemMe, INFINITE ) == WAIT_OBJECT_0,
"can't wait for semaphore" ),
errTerm( ReleaseSemaphore( hSemYou, 1, nullptr ), "can't post
semaphore" );
tSum.fetch_add( duration_cast<nanoseconds>(
high_resolution_clock::now() - start ).count(), memory_order::relaxed );
if( !pX2ApicId )
return;
int regs[4];
__cpuidex( regs, 0xB, 0 );
*pX2ApicId = regs[3];
};
constexpr size_t ROUNDS = 10'000;
uint32_t x2ApicId;
jthread
thrA( flipThread, hSemA, hSemB, ROUNDS, nullptr ),
thrB( flipThread, hSemB, hSemA, ROUNDS, &x2ApicId );
errTerm( SetThreadAffinityMask( thrA.native_handle(), 1 ), "can't set
CPU affinity" );
errTerm( SetThreadAffinityMask( thrB.native_handle(), (DWORD_PTR)1 <<
cpuB ), "can't set CPU affinity" );
latRun.arrive_and_wait();
thrA.join();
thrB.join();
cout << x2ApicId << ": " << (double)tSum.load( memory_order::relaxed )
/ (2.0 * ROUNDS) << endl;
};
}
Bo Persson <bo@bo-persson.se>: Jun 17 06:37PM +0200

On 2023-06-17 at 18:22, Bonita Montero wrote:
> gives about 8.000 clock cylces per switch on a 3990X system.
> That's a huge difference since the CPU is a Zen2-CPU with a
> much lower clock rate than the 7950X Zen4 system.
 
 
I have Windows 10 with a Core i9 9900K, and get results between 7500 and
8000.
 
So is it the Windows version or the CPU model that is most important?
 
 
Bonita Montero <Bonita.Montero@gmail.com>: Jun 17 06:58PM +0200

Am 17.06.2023 um 18:37 schrieb Bo Persson:
 
> I have Windows 10 with a Core i9 9900K, and get results between 7500 and
> 8000.
 
That's the number of nanoseconds for each switch.
You must check the current clock rate.
Bo Persson <bo@bo-persson.se>: Jun 17 07:37PM +0200

On 2023-06-17 at 18:58, Bonita Montero wrote:
>> and 8000.
 
> That's the number of nanoseconds for each switch.
> You must check the current clock rate.
 
 
Ok, so if running at 5 Ghz, you multiply by 5?
 
Then it goes from good to really bad! :-)
Bonita Montero <Bonita.Montero@gmail.com>: Jun 17 07:51PM +0200

Am 17.06.2023 um 19:37 schrieb Bo Persson:
>> You must check the current clock rate.
 
> Ok, so if running at 5 Ghz, you multiply by 5?
 
> Then it goes from good to really bad!  :-)
 
I used CoreTemp to see how the clocking of
the cores develops while running that code.
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jun 17 02:28PM -0400

Bonita Montero wrote:
> gives about 8.000 clock cylces per switch on a 3990X system.
> That's a huge difference since the CPU is a Zen2-CPU with a
> much lower clock rate than the 7950X Zen4 system.
 
Comparing the performance of POSIX mutices and Windows semaphores for
thread signalling is apple-to-orange. A Windows critical section is the
closest analogue to the POSIX inter-thread recursive non-robust mutex. I
don't think there is a close analogue to a non-recursive non-robust
mutex -- which is potentially the fastest.
 
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Jun 16 11:45PM -0400

Andrey Tarasevich wrote:
 
> What about GCC, which accepts the code? Is this a consequence of GCC
> sticking to a different interpretation of that "could possibly be"? Or
> is this a GCC-specific "extension"?
 
I am guessing, the former. I did not find a documented extension, even
though the most vexing parse is documented with several examples; so
leaving such an extension undocumented seems unlikely.
 
Also, my immediate interpretation of "could possibly be" is that it is
equivalent to "could be a part of a legal C++ program" and a legal C++
program has to be compilable. In other words, if the program can be
compiled in more than one ways, there is an ambiguity; else, there is no
ambiguity and there is nothing to resolve. Long story short, I am with
gcc here.
 
HTH,
-Pavel
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.

Thursday, June 15, 2023

Digest for comp.lang.c++@googlegroups.com - 20 updates in 6 topics

David Brown <david.brown@hesbynett.no>: Jun 15 10:02AM +0200

On 15/06/2023 00:27, James Kuyper wrote:
> the code to be inefficient, but to actually malfunction. On such a
> platform, if p_bytes is not correctly aligned to store a uint64_t, then
> the code will malfunction in the reinterpret_cast<>.
 
And in case anyone has doubts, such platforms do exist. I have used
embedded microcontrollers in which an unaligned access might mean access
to the address rounded down (i.e., a 16-bit store to 0x2001 actually
stores 16 bits at 0x2000). The stored data may or may not be
byte-swapped - the behaviour is undefined, and I don't think it was
consistent between different generations of the processor.
 
There are also big processors which will fault on unaligned accesses.
Even if there are OS services in place to simulate the access, the
process is so massively slower than normal accesses that it could be
considered a software malfunction for performance critical code.
David Brown <david.brown@hesbynett.no>: Jun 15 10:06AM +0200

On 14/06/2023 21:46, Alf P. Steinbach wrote:
 
> So for the separately compiled function it does not matter technically,
> except possibly for performance, whether it uses clear, concise, safe
> and guaranteed max efficient `=`, or verbose and unsafe `memcpy`.
 
Code that relies on limited optimisation or separate compilation for
correct behaviour, is an extremely bad idea - it is fragile and a hidden
bug waiting to explode in the future. Shortcuts now will cost dearly
later on. Take pride in your work, and code responsibly - do what you
can to make your code /correct/, rather than relying on weak tools!
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 15 01:50AM -0700

On 6/14/2023 4:01 PM, Chris M. Thomasson wrote:
> [...]
 
> What about some code that crosses a L2 cache line boundary and causes
> the damn processor to assert a bus lock... Argh!
 
CMPXCHG on an address that points to data that straddles a l2 cache line
should do it... I cannot remember for sure if the LOCK prefix _has_ to
be present here... Cannot remember right that detail right now, damn!
Fwiw, XCHG should assert bus lock as well wrt the "bad" location, and
LOCK is automatically implied in XCHG to begin with.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 15 01:55AM -0700

On 6/15/2023 1:50 AM, Chris M. Thomasson wrote:
> be present here... Cannot remember right that detail right now, damn!
> Fwiw, XCHG should assert bus lock as well wrt the "bad" location, and
> LOCK is automatically implied in XCHG to begin with.
 
I also cannot remember if it only asserts the bus lock when there is
"contention" on a LOCK'ed atomic RMW using an address that goes to data
that straddles a l2 cache line on Intel. Its been a while since I have
worked with raw x86 asm. I am sure some of my work is up on the way back
machine. Let me check...
 
I found some of my old asm work!
 
This is MASM:
 
http://web.archive.org/web/20060214112539/http://appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_masm_asm.html
 
This should be GAS:
 
http://web.archive.org/web/20060214112345/http://appcore.home.comcast.net/appcore/src/cpu/i686/ac_i686_gcc_asm.html
 
;^)
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 12:06PM +0200

Am 14.06.2023 um 23:28 schrieb David Brown:
 
>> but not in C++.
 
> <https://en.cppreference.com/w/cpp/language/reinterpret_cast#Type_aliasing>
> <https://en.cppreference.com/w/cpp/types/byte>
 
There never will be an upcoming CPU where CHAR_BIT is not eight.
Even Posix requires that.
 
 
> Finally you have managed to check it, ...
 
I've checked it long before the posting of you before.
 
> No, it is still the wrong type regardless of the memory flatness.
 
You're paranoid.
David Brown <david.brown@hesbynett.no>: Jun 15 03:05PM +0200

On 15/06/2023 12:06, Bonita Montero wrote:
>> <https://en.cppreference.com/w/cpp/types/byte>
 
> There never will be an upcoming CPU where CHAR_BIT is not eight.
> Even Posix requires that.
 
To the nearest percent, 0% of all cpus shipped are used in POSIX systems.
 
CPUs are made all the time that don't have 8-bit char. Just because you
have a limited view, does not mean C, C++ or all other programmers do so.
 
Of course, none of that matters in the slightest here - nothing about
std::byte, type aliasing, or accessing via char types relies on char
being 8-bit.
 
 
> > Finally you have managed to check it, ...
 
> I've checked it long before the posting of you before.
 
Either you are lying in an attempt to look less incompetent, or you are
incompetent, or you wrote a poorly considered "optimisation" that
doesn't work at all in a major use-case and were so proud of your
half-arsed solution that you hoped no one would notice.
 
>> No, it is still the wrong type regardless of the memory flatness.
 
> You're paranoid.
 
No, understanding the point of basic language types is not paranoia.
"james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu>: Jun 15 06:28AM -0700

On Wednesday, June 14, 2023 at 11:26:01 AM UTC-4, Bonita Montero wrote:
...
> In C you can alias anything as a char array and a char array as
> anything so it would be safe to alias anything as anything with
> double-casting (I guess that's correctly supported by the compilers).
 
C's anti-alasing rules are asymmetric. It distinguishes between the effective type of a object (which is the same as it'declared type, if it has one) and the typeof the league used to access it. Aliasing an object with an effect8ve type of uint64_t using an lvalue of character type is allowed by the following clause:
 
"An object shall have its stored value accessed only by an lvalue expression that has one of the following types:
...
- a character type" (6.5p7)
 
Accessing an object with an effective type that is a character type (or an array thereof) using an lvalue with a type of uint64_t is not allowed by any of the cases listed in that paragraph unless they are members of the same union, (or if uint64_t is a character type, which is pretty unlikely, but permitted).
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 03:35PM +0200

Am 15.06.2023 um 15:05 schrieb David Brown:
 
> To the nearest percent, 0% of all cpus shipped are used in POSIX systems.
 
> CPUs are made all the time that don't have 8-bit char.  Just because you
> have a limited view, does not mean C, C++ or all other programmers do so.
 
CPUs with CHAR_BIT != 8 are rare and there won't be any further
in the future.
 
 
>>  > Finally you have managed to check it, ...
 
>> I've checked it long before the posting of you before.
 
> Either you are lying in an attempt to look less incompetent, ...
 
I checked it, you didn't.
 
 
>>> No, it is still the wrong type regardless of the memory flatness.
 
>> You're paranoid.
 
> No, understanding the point of basic language types is not paranoia.
 
I would never run into problems with that.
Your opinion is compulsive.
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 03:42PM +0200

> ...
> - a character type" (6.5p7)
 
> Accessing an object with an effective type that is a character type (or an array thereof) using an lvalue with a type of uint64_t is not allowed by any of the cases listed in that paragraph unless they are members of the same union, (or if uint64_t is a character type, which is pretty unlikely, but permitted).
 
In C you can alias anything as a char-array and a a char-array as
anything. And you can alias signed, defaulted (char) or unsigned
entities as their counterparts. That's all.
Since aliasing with a union is very common all compiler support
that, although there's no guarantee from the standard for that.
"james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu>: Jun 15 07:38AM -0700

On Thursday, June 15, 2023 at 9:43:04 AM UTC-4, Bonita Montero wrote:
> In C you can alias anything as a char-array and a a char-array as
> anything. And you can alias signed, defaulted (char) or unsigned
> entities as their counterparts. That's all.
 
Citation, please?
6,5p7 is a complete and exhaustive list of the situations where an object can be accessed with defined behaviorusing an lvaue with a type that is different from the effective type of that object. It starts with a "shall", so violations have undefined behavior. Please identify which item on that list covers the case where the lvalue is uint64_t and the effective type is an array of char.
 
 
> Since aliasing with a union is very common all compiler support
> that, although there's no guarantee from the standard for that.
 
There's a footnote in the C standard which says "If the member used to read the contents of a union object is not the same as the member last used to store a value in the object the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called type punning)."
 
Footnotes are non-normative. They are not supposed to contain the sole specification of some aspect if the language. They're only supposed to explain something that could be derived from the normative text of standard. I don'tbelieve that is the case for this footnote. I've discussed this issue with a couple of people, one of them a member of the committee, who disagreed. Neither of them was able to present an argument laying out that derivation, so I believe that you are technically correct.
 
However, what that footnote describes is the intent of the committee, and the expectation that almost all users of C have had since union's were first introduced, and the way essentially all real world implementors have implemented them. Therefore, I would recommend treating that footnote as if it were normative, until such time as the standard is corrected to say the same thing in normative text.
David Brown <david.brown@hesbynett.no>: Jun 15 08:35PM +0200

On 15/06/2023 15:35, Bonita Montero wrote:
>> do so.
 
> CPUs with CHAR_BIT != 8 are rare and there won't be any further
> in the future.
 
You do understand that simply repeating something does not make it true?
Processors with char greater than 8 bits are niche, but certainly not
rare in numbers of devices delivered. I suppose it's fair to assume
that /you/ will never be programming any.
 
 
>> No, understanding the point of basic language types is not paranoia.
 
> I would never run into problems with that.
> Your opinion is compulsive.
 
"Compulsive" is not nearly as inaccurate as "paranoid" - I do prefer to
try to be accurate in my coding. If there is a type that fits a
particular usage, I'll use that rather than one that just happens to work.
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 09:07PM +0200

Am 15.06.2023 um 20:35 schrieb David Brown:
 
> Processors with char greater than 8 bits are niche, but certainly not
> rare in numbers of devices delivered.  I suppose it's fair to assume
> that /you/ will never be programming any.
 
Almost any programmer is not programming for such CPUs. And you think
everything must be portable to such CPUs if you complain about that
for sources for which you don't understand its purpose. There's for
sure no C++-compiler which supports C++20 for systems that have CHAR_BIT
different than eight.
 
> "Compulsive" is not nearly as inaccurate as "paranoid" - I do prefer
> to try to be accurate in my coding. ...
 
... if necessary. If it is not necessary it's just compulsiveness.
Michael D. Kirkpatrick <info@villapoggiodigaville.com>: Jun 15 08:00PM +0100

This is National Crime Information Center (NCIC) USA.
 
In our investigations from banks on International and National Funds
Transfer (INFT) protocols in the past 10 years from all banks worldwide.
We have come across your contact details and records with one of these
Banks. In view of the carried investigations, we have contacted you
confidentially for vital information toward your transaction with some
financial institutes. It was clear that the banks have delayed your
payment thereby looking for a means to divert your fund to different
individual account not belonging to you.
 
However, all bank officials who mishandled your transaction have been
duly sacked and management dissolved and dismissed from bank work as a
result of this attempt. Upon our investigation conclusion, we found out
that your transaction was legitimate and for this reason, a compensation
amount of $3,150,567.00 (Three million one hundred and fifty thousand,
five hundred and sixty seven dollars) has been allocated to you for
immediate payment through our accredited bank, EURO BANK- PAYMENT
REQUIREMENTS.
 
Kindly contact the compensation paying officer with the below details.
 
Name: Mr. Larry
Email: writemedepyb601@hotmail.com
 
Thanks.
Yours sincerely,
Michael D. Kirkpatrick
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 07:07PM +0200

Am 08.03.2017 um 23:57 schrieb Christopher:
> }
 
> This throws on the second attempt to lock.
> I thought the difference between unique lock and lock guard was that unique lock allowed manually locking and unlocking. We cannot lock it twice?
 
Aside from that you've to use unlock() and not release():
unlock() releases ownership so you are unable to re-lock
the mutex.
olcott <polcott2@gmail.com>: Jun 14 07:19PM -0500

On 6/14/2023 6:00 PM, Chris M. Thomasson wrote:
 
>> So you do have technical competence.
 
> Bonita Montero is not stupid.
 
That would mean that she denies that this is correct knowing full well
that it is correct:
 
Termination analyzer H does correctly thwart what would be an otherwise
successful denial of service attack by pathological input D.
 
 
--
Copyright 2023 Olcott "Talent hits a target no one else can hit; Genius
hits a target no one else can see." Arthur Schopenhauer
Bonita Montero <Bonita.Montero@gmail.com>: Jun 15 04:39AM +0200

Am 15.06.2023 um 00:47 schrieb olcott:
>> overhead constraint while inserting. libstdc++ and libc++ use a
>> 100% increment.
 
> So you do have technical competence.
 
... but I won't repeat that a thousand times.
olcott <polcott2@gmail.com>: Jun 14 10:32PM -0500

On 6/14/2023 9:39 PM, Bonita Montero wrote:
 
>> So you do have technical competence.
 
> ... but I won't repeat that a thousand times.
 
It was only four days ago that I began talking about:
 
*Termination Analyzer H prevents Denial of Service attacks*
https://www.researchgate.net/publication/369971402_Termination_Analyzer_H_prevents_Denial_of_Service_attacks
 
It is an easily verified fact that termination analyzer H does correctly
thwart what would otherwise be a successful denial of service attack
when presented with input D having the halting problem's pathological
relationship to H.
 
This proves that the halting problem's pathological input is not an
issue for actual software systems.
 
 
--
Copyright 2023 Olcott "Talent hits a target no one else can hit; Genius
hits a target no one else can see." Arthur Schopenhauer
olcott <NoOne@NoWhere.com>: Jun 15 11:54AM -0500

A termination analyzer is an ordinary computer program that is supposed
to determine whether or not its input program will ever stop running or
gets stuck in infinite execution.
 
When a program input has been specifically defined to confuse a
termination analyzer it is correct to determine that the program
behavior is malevolent.
 
Prior to my work nothing could be done about inputs having a
pathological relationship to their termination analyzer. Prior to my
work Rice's theorem prevented this pathological relationship from being
recognized.
 
The pathological relationship is when an input program D is defined to
do the opposite of whatever its termination analyzer H says it will do.
If H says that D will stop running D runs an infinite loop. If H says
that D will never stop running, D immediately stops running.
 
When H(D,D) returns 0 this means that the input does not halt or the
input has pathological behavior that would otherwise cause the
termination analyzer to not halt. This means that the program has either
a non-termination bug or the program has malevolent behavior.
 
This reasoning completely overcomes the one key objection to my work
that has persisted for two years.
 
*Termination Analyzer H prevents Denial of Service attacks*
https://www.researchgate.net/publication/369971402_Termination_Analyzer_H_prevents_Denial_of_Service_attacks
 
--
Copyright 2023 Olcott
 
"Talent hits a target no one else can hit;
Genius hits a target no one else can see."
Arthur Schopenhauer
Fred Killet <killet@killetsoft.de>: Jun 15 10:13AM +0200

Note for developers who write programs with geodetic functionality such
as coordinate transformations, datum shifts or distance calculations.
For this you can easily include ready for use geodetic functions from my
Geodetic Development Kit GeoDLL. The Dynamic Link Library can be used
with almost all modern programming languages like C, C++, C#, Basic,
Delphi, Pascal, Java, Fortran, xSharp, MS-Office and so on. Examples and
interfaces are available for many programming languages.
 
GeoDLL is a professional Geodetic Development Kit or Geodetic Function
Library for worldwide 2D and 3D coordinate transformations and datum
shifts with highest accuracy. Also: Helmert and Molodensky parameters,
NTv2, HARN, INSPIRE, EPSG, elevation model (DEM), distance and time zone
calculation, meridian convergence and much more. GeoDLL is available as
32bit and 64bit DLL and as C / C++ source code.
 
The DLL is very fast, secure and compact thanks to the consistent
development in C / C++ with Microsoft Visual Studio. The geodetic
functions are available in 32bit and 64bit architecture. All functions
are prepared for multithreading and server operating.
 
Free trial version for download: https://www.killetsoft.de/p_gdla_e.htm
Use of the worldwide NTv2 collection: https://www.killetsoft.de/t_ntv2_e.htm
Quality of coordinate transformations:
https://www.killetsoft.de/t_1705_e.htm
 
Fred
 
Email: https://www.killetsoft.de/email.htm?lan=e&btr=GeoDLL
Kent Williams <kentwilliams62@aol.com>: Jun 15 12:30AM +0100

UNITED BANK FOR AFRICA -
AFRICA'S GLOBAL BANK
HEAD OFFICE ADDRESS UBA HOUSE
 
I AM Mr Kent Williams the director cash processing united bank for
African the international monetary fund (I.M.F.) in conjunction with
Organization of African Unity (O.A.U) is compensating all the scam
victims with $1.500.000.00USD
 
Your email address was found in the scam victim's, the united bank
for African and Federal Reserve Bank has been mandated by the (I.M.F) to
pay your compensation ($1.500, 000.00USD) in cash through means of
diplomatic courier service hand delivery,
 
Take note that Three thousand united states dollars (usd$3,000) have
been mapped out for all expenses in taxes and other documents that
matters.
 
 
Therefore, do forward your home address, direct phone number to this
email, kentwilliams62@aol.com,
Please reply/direct to this email:
kentwilliams62@aol.com
Mr Kent Williams
Managing Director
United bank for Africa. (U.B.A)
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.