Thursday, March 16, 2017

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

"Öö Tiib" <ootiib@hot.ee>: Mar 16 11:39AM -0700

On Wednesday, 15 March 2017 18:07:04 UTC+2, bitrex wrote:
> structures would not throw, which could speed some operations, but I
> don't recall the details.
 
> If anyone could elaborate I'd appreciate it...
 
The effect of noexcept is typically quite small and it does not help to
find defects faster (unlike for example constexpr) so I use it only when
optimizing for speed. I optimize for speed only in late stage of project
and that affects only small subset of code base.
 
When I use it I basically specify everything that shows up in profile
but can't possibly throw as noexcept and that is it.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 07:49PM +0100

> and assignment operators to indicate to certain STL containers that the
> structures would not throw, which could speed some operations, but I
> don't recall the details.
 
noexcept could theoretically help compilers to optimize the tables used
with table-driven exception-handling. This means, that for each point
where a noexcept-function is called, the compiler wouldn't have to
create a handler-code or table-entry for exceptions bubbling through
the call-stack for this call.
 
--
http://facebook.com/bonita.montero/
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 08:05PM +0100

> noexcept could theoretically help compilers ...
 
That doesn't seem to be only theory.
The following code crashes if you uncomment noexcept
with Visual C++ 2017 on Windows and g++ on Linux.
 
void f2()
{
throw int( 123 );
}
 
void f1() // noexcept
{
f2();
}
 
 
int main()
{
try
{
f1();
}
catch( int )
{
}
}
 
 
 
--
http://facebook.com/bonita.montero/
peter koch <peter.koch.larsen@gmail.com>: Mar 16 12:19PM -0700

Den torsdag den 16. marts 2017 kl. 20.05.20 UTC+1 skrev Bonita Montero:
> {
> }
> }
 
"Crashes"? No. The program is terminated - as it should be.
peter koch <peter.koch.larsen@gmail.com>: Mar 16 12:25PM -0700

Den onsdag den 15. marts 2017 kl. 17.07.04 UTC+1 skrev bitrex:
> structures would not throw, which could speed some operations, but I
> don't recall the details.
 
> If anyone could elaborate I'd appreciate it...
 
Read the documentation - see eg. cppreference.com.
nothrow could give significant performance improvements, in particular on move constructors when operating on containers. As an example, moving elements in a std::vector becomes much faster if its elements are cheap to move compared to assign and the move constructors are nothrow.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 08:32PM +0100

> "Crashes"? No. The program is terminated - as it should be.
 
I tried it with Windows Services for Linux, i.e. the Linux-environment
for Windows, and g++ 4.8.4. With this environment I get a core-dump.
And with Visual C++ 2017 the program also crashes when I run the
release-build; the debug-build shows that abort() is called.
 
--
http://facebook.com/bonita.montero/
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 16 09:03PM +0100

On 16-Mar-17 8:32 PM, Bonita Montero wrote:
> for Windows, and g++ 4.8.4. With this environment I get a core-dump.
> And with Visual C++ 2017 the program also crashes when I run the
> release-build; the debug-build shows that abort() is called.
 
The standard requires that `std::terminate` is called. I wasn't aware
that Visual C++ implemented this, thanks for testing. It did not
implement the general mechanism for C++03 throw specifications.
 
<url: http://en.cppreference.com/w/cpp/language/noexcept_spec>
 
The behavior of `std::terminate` can be modified by installing a
terminate handler. The default handler just calls `abort()`.
 
`abort` in turn raises the SIGABRT signal.
 
Handling that signal is a lower level way to modify the behavior.
 
However, in C++ a signal handler can't do just about anything without
getting into Undefined Behavior, and for a hosted environment I can't
think of any useful modification at that low level.
 
 
Cheers!,
 
- Alf
Ramine <toto@toto.net>: Mar 16 01:30AM -0400

Hello,
 
My work also is this:
 
I am a white arab, and i am a computer programmer and i have a diploma
in Microelectronics and informatics and i have also studied and
succeeded one year of mathematics at university level, and i am
an experienced programmer in parallel programming and synchronization
algorithms and i have invented many synchronization algorithms.
 
I am an experienced programmer who knows about verification and
validation(V&V) of softwares and i know about design of softwares,
and i know about design by contract, and i know about the goals of
extreme programming and agile, but this is not my interest actually, i
am more interested in inventing new algorithms like my synhronization
algorithms that i have invented, i have written many softwares,
but my interest actually is parallel programming and inventing
synchronization algorithms, this is why you have seen
me posting some of my inventions that are my C++ synchronization objects
library, also i am porting my algorithms to real-time OSs such
as QNX and On Time RTOS-32 to be able to do robotics with them etc.
 
Also my C++ synchronization objects library for Windows and Linux was
updated, and i have thoroughly tested it again and i think that it is
more stable and fast now.
 
And be happy with my C++ synchronization objects library !
 
 
You can download the new updated version from:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 04:14PM +0100

> ..., and i am an experienced programmer ...
 
You're a manic programmer that is only able to write buggy
(see your frequent correction-updates) micro-frameworks.
Consult a psychiatrist!
 
--
http://facebook.com/bonita.montero/
Daniel <danielaparker@gmail.com>: Mar 16 09:47AM -0700

On Thursday, March 16, 2017 at 11:14:53 AM UTC-4, Bonita Montero wrote:
> > ..., and i am an experienced programmer ...
 
> You're a manic programmer that is only able to write buggy
> (see your frequent correction-updates) micro-frameworks.
 
Whatever the merits of posting the correction-updates in the newsgroup, I think it is fair to say that practically every project has an issue log,
every project require updates, and so your conclusion that this implies the
OP is only able to write buggy code is beyond stupid.
 
Best regards,
Daniel
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 06:40PM +0100

> ... your conclusion that this implies the
> OP is only able to write buggy code is beyond stupid.
 
Look at the bug-frequency and relate it to the size of his code.
He won't be able to handle even a 1.000-lines-project.
He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
--
http://facebook.com/bonita.montero/
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 16 11:00AM -0700

On Thursday, March 16, 2017 at 1:40:36 PM UTC-4, Bonita Montero wrote:
 
> Look at the bug-frequency and relate it to the size of his code.
> He won't be able to handle even a 1.000-lines-project.
> He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
He is perplexing. His posts indicate highly atypical thinking, and
there are definitely signs that something's awry with him.
 
He posts that he's a white Arab, for example. I'm not sure how that
matters. People are people and they have skills. So long as they're
communicative, it really doesn't make much differences where they're
from. He also contradicts himself. He posts things like "this is my
last post," and then posts further. He posts "I will not do xyz," and
then "I will do xyz."
 
He does exhibit behaviors which can only be classified as abnormal
relative to the general populations, if not truly demonstrative of
exhibiting some real mental disorder.
 
What perplexes me the most is why he posts so many new topics rather
than amending the prior one(s) he created for the subject(s) when he
has related content, or later revisions. Also, why he contradicts
himself so often with the "I won't do xyz" and then "I will do xyz"
posts. He's done that in other groups I read for many months.
 
It is really quite puzzling.
 
Thank you,
Rick C. Hodgin
Daniel <danielaparker@gmail.com>: Mar 16 11:02AM -0700

On Thursday, March 16, 2017 at 1:40:36 PM UTC-4, Bonita Montero wrote:
 
> Look at the bug-frequency and relate it to the size of his code.
> He won't be able to handle even a 1.000-lines-project.
> He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
Lots of people have issues of one kind or another, and function despite them. I see no reason to be rude or discourteous to this poster.
 
Daniel
Ramine <toto@toto.net>: Mar 16 02:24PM -0400

On 3/16/2017 1:40 PM, Bonita Montero wrote:
 
> Look at the bug-frequency and relate it to the size of his code.
> He won't be able to handle even a 1.000-lines-project.
> He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
Your affirmation is not precise and it is futility:
 
 
I have just corrected a bug with my Ticket Spinlock with a proportional
back-off..
 
Here it is, look at the Enter() procedure, i have added the following:
 
==
tail1:=FCount3^.FCount3;
head1:=(slot-1);
 
if tail1 < head1
then j:= (High(long)-tail1)+(1+head1)
else j:=(head1-tail1);
==
 
 
And now it is working properly:
 
Here is the code of the Enter() and Leave() methods:
 
procedure TTicketSpinLock.Enter;
 
var head1,tail1,j,i:long;
slot:long;
begin
 
slot:=LockedIncLong(FCount2^.FCount2);
 
while ((slot-1) <> FCount3^.FCount3)
do
begin
 
{$IFDEF FPC}
ThreadSwitch;
{$ENDIF}
{$IFDEF Delphi}
SwitchToThread();
{$ENDIF}
 
tail1:=FCount3^.FCount3;
head1:=(slot-1);
 
if tail1 < head1
then j:= (High(long)-tail1)+(1+head1)
else j:=(head1-tail1);
 
 
i:=0;
 
repeat
 
asm pause end;
 
if i=(j*100) then break;
 
inc(i);
 
until false;
 
end;
 
 
end;
//==============================================================================
 
procedure TTicketSpinLock.Leave;
 
begin
mfence;
inc(FCount3^.FCount3);
//sleep(0);
end;
 
end.
Daniel <danielaparker@gmail.com>: Mar 16 11:28AM -0700

On Thursday, March 16, 2017 at 2:01:13 PM UTC-4, Rick C. Hodgin wrote:
 
> It is really quite puzzling.
 
It's also puzzling that you keep proselytizing here when you have been asked
to turn it off, to shut it down.
 
 
Daniel
Ramine <toto@toto.net>: Mar 16 02:28PM -0400

On 3/16/2017 2:24 PM, Ramine wrote:
> //sleep(0);
> end;
 
> end.
 
 
You will find the source code inside my scalable MLock zip file here:
 
https://sites.google.com/site/aminer68/scalable-mlock
 
My scalable MLock that is a scalable lock is also one of other inventions.
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 16 07:29PM +0100

> Lots of people have issues of one kind or another, and function despite them. I see no reason to be rude or discourteous to this poster.
 
His posting-flood is dusgusting.
 
--
http://facebook.com/bonita.montero/
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 16 11:35AM -0700

On Thursday, March 16, 2017 at 2:28:28 PM UTC-4, Daniel wrote:
 
> > It is really quite puzzling.
 
> It's also puzzling that you keep proselytizing here when you have been asked
> to turn it off, to shut it down.
 
I can see how that would be puzzling. It's because the warnings I
give don't relate to things which happen in immediacy, but only to
those things which are coming after we leave this world. For many
people, they do not correlate the two, or believe those things I
teach as being true.
 
That fact makes me sad to no end, which is why I keep trying with
different descriptions, different passages, different sources, and
the multiple posts over time. It is my greatest hope that at some
point the connection will be made and the solidity of the message
will be received and understood.
 
I know this: For those who take heed of the warning, they already
know why I do it. But for those who do not take heed, the day will
still arrive where they then know why I spent so much time trying,
and with such passion, to reach out to save those souls which will
be, at that point, lost forever. Only then, when it's too late,
will many people understand. But it is my greatest hope that there
will be many who come to understand long before that last day.
 
Thank you,
Rick C. Hodgin
 
--
https://www.facebook.com/rick.c.hodgin
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 16 07:46PM +0100

On 16-Mar-17 6:40 PM, Bonita Montero wrote:
 
> Look at the bug-frequency and relate it to the size of his code.
> He won't be able to handle even a 1.000-lines-project.
> He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
Hm, I'd give up my right hand to be ambidextrous.
 
Cheers!,
 
- Alf
"Chris M. Thomasson" <invalid@invalid.invalid>: Mar 16 12:56PM -0700

On 3/16/2017 11:46 AM, Alf P. Steinbach wrote:
>> He won't be able to handle even a 1.000-lines-project.
>> He is a mentally disordered boy. I'd bet my right hand that he is manic.
 
> Hm, I'd give up my right hand to be ambidextrous.
 
LOL! ;^D
peter koch <peter.koch.larsen@gmail.com>: Mar 16 12:44AM -0700

Den onsdag den 15. marts 2017 kl. 20.24.31 UTC+1 skrev Rick C. Hodgin:
 
> You lose the ability to access directly via index, but if that's not an
> issue, the gains for random insertion and movement are desirable,
> as in the OP's need to push_front().
 
That most likely is not correct. The gain from having access to sequential memory is often bigger than then loss when you have to move things around. There could be exceptions when the objects are expensive to move or copy, but this will not normally be the case.
When you have the specific pattern of push/pop front or push/pop back, a deque could be an option. Just beware that the Microsoft implementation of deque is not that good.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 16 10:50AM -0700

On Thursday, March 16, 2017 at 3:44:44 AM UTC-4, peter koch wrote:
> > issue, the gains for random insertion and movement are desirable,
> > as in the OP's need to push_front().
 
> That most likely is not correct.
 
Which part is most likely not correct? :-)
 
> than then loss when you have to move things around. There could be
> exceptions when the objects are expensive to move or copy, but this
> will not normally be the case.
 
One could construct an array which allows indexed traversal, but each
time a new insertion is made the array must be reconstructed. If it's
a more often read in an indexed manner than updated, it could be a
desirable alternative.
 
If you're referring to sequential access in memory, you could allocate
a block of memory that's N * the size of the thing you'll be pushing,
plus the overhead of the link list wrapper, so that all of the references
will be inside that sequential block.
 
> When you have the specific pattern of push/pop front or push/pop
> back, a deque could be an option. Just beware that the Microsoft
> implementation of deque is not that good.
 
Thank you,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Mar 16 09:00AM +0100

On 15/03/17 18:31, Lynn McGuire wrote:
 
> I am continuing to hear more and more good things about the LLVM
> compilers and backend code generator. I just wish that there was an
> platform independent IDE for them.
 
You mean like Eclipse, Netbeans, JEdit, Code::Blocks, CodeLite, Geany,
GPS, CLion, Emacs....
 
llvm is a set of tools and libraries, with the clang front-end for C and
C++. It is not an editor, or a project manager, or a debugger. Asking
for an "LLVM IDE" is a bit like saying "Toyota make good cars. I just
wish they made garages, roads, and fluffy dice too".
 
scott@slp53.sl.home (Scott Lurndal): Mar 16 01:58PM

>>the compiler writers and a part of the C++ standards would be
>>good also.
 
>No other language (standardized or not) has this,
 
Java has AWT & Swing.
Ramine <toto@toto.net>: Mar 15 11:40PM -0400

ello,
 
I am an experienced programmer in parallel programming and in
synchronization algorithms, i have invented many synchronization
algorithms, this is why i am finding real-time systems programming
easy, i am actually programming for QNX real-time OS that is very good
and for On Time RTOS-32 that is also good.
 
Here is QNX:
 
http://www.qnx.com/content/qnx/en.html
 
And here is One Time RTOS-32
 
http://www.on-time.com/rtos-32.htm
 
I love them both, and i am porting also my softwares from Delphi(Object
Pascal) to C++ using Delphi Dynamic Link Libraries also, since Delphi
compilers don't reorder loads and stores even with compiler
optimization, and this is less error prone than C++ that follows a
relaxed memory model when compiled with optimization,
i am getting smarter doing this job, i have not choosen VxWorks
real-time OS because VxWorks is expensive , and i have found QNX
real-time OS much better in many ways, please stay tuned
i am actually finishing porting some of my softwares to
those real-time OSs, and to be able to know much about
me, please look at the source code of my C++ and Delphi
MemPool for real-time systems to see how it is more efficient and
correct, and i have tested them and stabilized them more using also
a memory leak detector, here they are:
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
and
 
https://sites.google.com/site/aminer68/mempool-for-realtime-systems
 
 
 
Thank you,
Amine Moulay Ramdane.
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: