Saturday, March 18, 2017

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

Bonita Montero <Bonita.Montero@gmail.com>: Mar 18 08:19PM +0100

You are an idiot. Locks are mandantory when you access shared
data-structures and when you use locks, memory-reordering isn't
an issue because when using locks constrains the threads not to
reorder access beyond this locks.
 
--
http://facebook.com/bonita.montero/
Ramine <toto@toto.net>: Mar 18 03:25PM -0400

On 3/18/2017 3:19 PM, Bonita Montero wrote:
> data-structures and when you use locks, memory-reordering isn't
> an issue because when using locks constrains the threads not to
> reorder access beyond this locks.
 
I am not an idiot Sir Bonita Montero, i have invented many
synchronization algorithms, and i am speaking also
about this synchronization algorithms like locks etc.
when you invent or you design those synchronization algorithms
you have to think about sequential consistency.
 
 
 
Thank you,
Amine mOULAY Ramdane.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 18 12:36PM -0700

Ramine wrote:
> I am not an idiot Sir Bonita Montero...
 
Bonita is female, Ramine.
 
Thank you,
Rick C. Hodgin
Ramine <toto@toto.net>: Mar 18 03:37PM -0400

On 3/18/2017 3:19 PM, Bonita Montero wrote:
> data-structures and when you use locks, memory-reordering isn't
> an issue because when using locks constrains the threads not to
> reorder access beyond this locks.
 
Sir Bonita Montero, you have to understand me, i am thinking security
like in Spark and ADA..
 
Now you have understood the philosophy of C and C++ compilers,
it's that they give much more priviledge to speed than to security, they
look like assembler compilers in this regard, this is why they follow a
weak memory model that is more error prone than Delphi and FreePascal
compilers.
 
I have invented many synchronization algorithms, and i am speaking also
about this synchronization algorithms like locks etc.
when you invent or you design those synchronization algorithms
you have to think about sequential consistency.
 
C++ compilers today follow a weak memory model and this is error prone
when you want to reason about sequential consistency when doing parallel
programming.
 
But Delphi and FreePascal compilers don't reorder loads and stores,
so it is less error prone than C++ on a strong memory model of x86
architecture and on strong memory model of ARM architecture.
 
This is why i am using Delphi and Freepascal Dynamic Link Libraries
from C++ compilers.
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 18 08:37PM +0100

> about this synchronization algorithms like locks etc.
> when you invent or you design those synchronization algorithms
> you have to think about sequential consistency.
 
Writing synchonization-primitves for C++ since C++11 is not necessary
because C++11 supplies almost anything you need with mutexes and con-
dition-variables. Using this means ensures proper memory-odering.
Such things like lock-free structures are beneficial in very rare cases.
 
--
http://facebook.com/bonita.montero/
Ramine <toto@toto.net>: Mar 18 03:43PM -0400

On 3/18/2017 3:37 PM, Bonita Montero wrote:
> because C++11 supplies almost anything you need with mutexes and con-
> dition-variables. Using this means ensures proper memory-odering.
> Such things like lock-free structures are beneficial in very rare cases.
 
Madam Bonita Montero, you have to understand me, because when you think
security like in Spark and ADA, you don't talk as you are talking,
because in safety-critical systems you have to ensure a high level
of security, like is doing Spark and ADA, this is why your answer is
not acceptable to me.
 
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 18 08:52PM +0100

> because in safety-critical systems you have to ensure a high level
> of security, like is doing Spark and ADA, this is why your answer is
> not acceptable to me.
 
That doesn't make wrong what I wrote.
 
--
http://facebook.com/bonita.montero/
Ramine <toto@toto.net>: Mar 18 03:57PM -0400

On 3/18/2017 3:52 PM, Bonita Montero wrote:
>> of security, like is doing Spark and ADA, this is why your answer is
>> not acceptable to me.
 
> That doesn't make wrong what I wrote.
 
I was aware of you suggestion to use just synchonization-primitives of
C++ since C++11..
 
But i have invented many synchronization algorithms that i have
ported to C++, and since Delphi and FreePascal compilers don't reorder
loads and stores, so it is less error prone than C++ on a strong memory
model of x86 architecture and on strong memory model of ARM
architecture, this is why i am using Delphi and Freepascal Dynamic Link
Libraries from C++ compilers.
 
 
Here it is, read about my inventions:
 
C++ synchronization objects library for Windows and Linux:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 18 08:59PM +0100

Your "inventions" are useless. C++ supplies everything that is needed.
And no one needs your code with very frequent bug-updates.
 
--
http://facebook.com/bonita.montero/
Ramine <toto@toto.net>: Mar 18 04:04PM -0400

On 3/18/2017 3:59 PM, Bonita Montero wrote:
> Your "inventions" are useless. C++ supplies everything that is needed.
> And no one needs your code with very frequent bug-updates.
 
You are rude and you are getting stupid, where do you find my
SemaMonitor on C++ ? and where do you find my scalable RWLocks
on C++ ? and where do you find my scalable SeqlockX on C++ ?
and where do you find my scalable MLock on C++ ? etc.
you don't find them on C++ and this is the truth.
 
And i am an experienced programmer and i think that my C++
synchronization objects library is more stable and fast.
 
Here it is, read about my inventions:
 
C++ synchronization objects library for Windows and Linux:
 
https://sites.google.com/site/aminer68/c-synchronization-objects-library
 
 
Thank you,
Amine Moulay Ramdane.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 18 09:13PM +0100

> on C++ ? and where do you find my scalable SeqlockX on C++ ?
> and where do you find my scalable MLock on C++ ? etc.
> you don't find them on C++ and this is the truth.
 
You can derive the necessity for such synchronization-primitives
from the frequency that they are implemented / used.
 
> And i am an experienced programmer and i think that my C++
> synchronization objects library is more stable and fast.
 
With frequent bug-updates ...
 
--
http://facebook.com/bonita.montero/
Ramine <toto@toto.net>: Mar 18 04:20PM -0400

On 3/18/2017 4:13 PM, Bonita Montero wrote:
 
>> And i am an experienced programmer and i think that my C++
>> synchronization objects library is more stable and fast.
 
> With frequent bug-updates ...
 
And where do you find my following threadpool that scales well and
that supports processor groups on windows and that is NUMA-aware and
NUMA efficient and that eliminates the contention on the consumer
threads side ? etc. You don't find it elsewhere, and you don't find it
in C++
 
Please look at it and read about it here:
 
https://sites.google.com/site/aminer68/an-efficient-threadpool-engine-that-scales-well
 
You have to reason correctly Madam, i am an experienced programmer
who knows more about programming.
 
 
Thank you,
Amine Moulay Ramdane.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 11:41AM -0700

On Saturday, March 18, 2017 at 3:22:14 PM UTC+5:30, kushal bhattacharya wrote:
> Hi,
> How do i get this group into the newsserver.PLease show me some sample example about this
 
hi,
Could you please show me a snapshot
about how to get that .
I have trying for hours looking for it.
Thanks,
Kushal
jt@toerring.de (Jens Thoms Toerring): Mar 18 07:32PM

> Could you please show me a snapshot
> about how to get that .
 
Sorry, I have no idea which newreader you're using. And
I'm using a text-only reader (tin) where I press 'y' to
get a list of all available newsgroups and press 's'
when the cursor is on the one I want to subscribe to.
But I guess that's not very relevant for you... Per-
haps if you write what you're using as a newsreader
(or try to use, at the moment you seem to be posting
from Google groups) someone using the same one may
be able to help out.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 12:39PM -0700

I am using eternal.september.org newsreader
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 11:51AM -0700

On Saturday, March 18, 2017 at 8:01:42 PM UTC+5:30, Jerry Stuckle wrote:
> Jerry Stuckle
> jstucklex@attglobal.net
> ==================
 
hi,
So what should I do in this case?
Paavo Helde <myfirstname@osa.pri.ee>: Mar 18 09:08PM +0200

On 18.03.2017 20:51, kushal bhattacharya wrote:
>> element can cause any pointer or iterator in other threads to become
>> invalid. This will cause undefined results (including potential segfaults).
 
> So what should I do in this case?
 
It's simple, do not keep or use any pointer or iterator values after
releasing the lock.
 
So far you have not shown to us any code example which actually performs
the locking. It might be that your locking code just does not do what
you think it is doing. Post some more complete examples of how you read
and modify the deque.
"Öö Tiib" <ootiib@hot.ee>: Mar 18 12:12PM -0700

On Saturday, 18 March 2017 20:51:58 UTC+2, kushal bhattacharya wrote:
> > invalid. This will cause undefined results (including potential segfaults).
 
> hi,
> So what should I do in this case?
 
How can we know? We do not know your code and there are endless ways how
to write code that manipulates containers.
 
If you don't want references to deque invalidated then push_front,
push_back, emplace_front and emplace_back do not invalidate any references
to elements of the deque. Also when erasing at either end of the deque,
references to non-erased elements are not invalidated by erase, pop_front
and pop_back. Also you can just avoid having any references to container
elements stored anywhere once you released a lock to it.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 12:21PM -0700

On Friday, March 17, 2017 at 1:22:51 PM UTC+5:30, kushal bhattacharya wrote:
> The issue i am facing is i am trying to remove element from deque when a certain condition is met from different threads and i enlcosing the whole thing in lock.it works for some steps but after that when i removing elements in later steps i get segmentation fault .What could be the probable reasons for this kind of issues ?
> Thanks,
> Kushal
 
{
lock_guard<mutex> lock_guard1(m2);
std::find_if(msg_lists.begin(), msg_lists.end(),
[&](std::pair<int, shared_ptr<msg_list>> msg_obj)mutable {
if ((msg_obj.second->get_opcode() == PUBREC) &&
(msg_obj.second->get_msg_id() == msg_id) &&
(msg_obj.second->get_sockfd() == sock_fd)) {
// {
// lock_guard<mutex> lock_guard1(m2);
msg_obj.second->set_opcode(PUBCOMP);
msg_obj.second->set_sentflg(false);
cout << "MSG LIST UPDATED in PUBREL"
<< ((msg_obj.second->get_opcode() == PUBCOMP) &&
(msg_obj.second->get_msg_id() == msg_id) &&
(msg_obj.second->get_sockfd() == sock_fd)) << endl;
data_cond.notify_one();
// }
}
return ((msg_obj.second->get_opcode() == PUBCOMP) &&
(msg_obj.second->get_msg_id() == msg_id) &&
(msg_obj.second->get_sockfd() == sock_fd));
});
}
 

 
This is the part where i push the element into the container
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 12:24PM -0700

On Friday, March 17, 2017 at 1:22:51 PM UTC+5:30, kushal bhattacharya wrote:
> The issue i am facing is i am trying to remove element from deque when a certain condition is met from different threads and i enlcosing the whole thing in lock.it works for some steps but after that when i removing elements in later steps i get segmentation fault .What could be the probable reasons for this kind of issues ?
> Thanks,
> Kushal
 
 
{
lock_guard<mutex> lock_guard1(m2);
msg_id = pars_obj->get_msgid();
shared_ptr<msg_list> msg_obj(new msg_list(lastinsrt_id, sock_fd, PUBACK));
// opcode = PUBACK;
msg_obj->set_msg_id(msg_id);
topic_name = pars_obj->get_topic();
msg_obj->set_topic(topic_name);
//tmp_msg_lists =&msg_lists;
// msg_Contnr *tmp_msg_lists=&msg_lists;
// msg_lists.push_back(msg_obj);
msg_lists[msg_counter] = msg_obj;
msg_counter++;
data_cond.notify_one();
}
 
} else if (qos == 2) {
// int msg_idLSB = pblshpacket.msgid_Lsb;
// int msg_idMSB = pblshpacket.msgid_Msb;
 
{
lock_guard<mutex> lock_guard1(m2);
msg_id = pars_obj->get_msgid();
shared_ptr<msg_list> msg_obj(new msg_list(lastinsrt_id, sock_fd, PUBREC));
// opcode = PUBREC;
msg_obj->set_msg_id(msg_id);
topic_name = pars_obj->get_topic();
msg_obj->set_topic(topic_name);
msg_obj->set_opcode(PUBREC);
// msg_Contnr *tmp_msg_lists=&msg_lists;
// msg_lists.push_back(msg_obj);
msg_lists[msg_counter] = msg_obj;
msg_counter++;
data_cond.notify_one();
}
// }
// data_cond.notify_one();
}
}
"Chris M. Thomasson" <invalid@invalid.invalid>: Mar 18 12:30PM -0700

On 3/18/2017 1:00 AM, Christian Gollwitzer wrote:
> on Linux, you can use Valgrind to check it for memory errors and
> Helgrind to find synchronization errors. These are two of the best
> debugging tools I've ever used.
 
Have you ever tried ThreadSanitizer?
 
https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
 
Or Relacy?
 
http://www.1024cores.net/home/relacy-race-detector
 
Imvho, Relacy is pretty nice, dedicated to checking C++ memory model,
wrt the primitives it offers. It can help one model their apps sync
scheme. Have not tried ThreadSanitizer yet.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 18 12:38PM -0700

On Sunday, March 19, 2017 at 1:00:50 AM UTC+5:30, Chris M. Thomasson wrote:
 
> Imvho, Relacy is pretty nice, dedicated to checking C++ memory model,
> wrt the primitives it offers. It can help one model their apps sync
> scheme. Have not tried ThreadSanitizer yet.
 
 
 
I will give it a shot then thanks man
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 18 07:13PM

On 18/03/2017 06:02, Gareth Owen wrote:
 
>> Colour emojis implemented in "neoGFX" my C++ GUI/game library:
 
>> http://neogfx.org/temp/emoji.png
 
> Looks very nice.
 
Thanks! Today I am adding MVC support to neoGFX. :)
 
/Flibble
Manfred <noname@invalid.add>: Mar 18 05:15PM +0100

On 3/17/2017 8:21 PM, Paavo Helde wrote:
 
>> I think you misunderstand.
 
>> Manfred is not talking about the usual elision but about the
>> `std::vector`'s choice about what to call.
Indeed
 
> I just wanted to stress than for a sanely written program there would be
> no difference (other than performance-wise, potentially) what
> std::vector decides to call or not to call when resizing the buffer.
Agreed. Only I would say that for a /well written/ program there would
be no difference. (I would agree that code that would be affected by
such difference would be bad - I wouldn't go as far as /insane/)
 
 
> Maybe I should expand my opinion a bit more: any program whose semantics
> depend on the copy or move constructors called or not called, or having
> exception-throwing move constructors or destructors, is extremely fragile.
 
I would agree that code that /depends/ on the difference in semantics
between copy and move is fragile, but still there /is/ a difference
between them.
Coming back to the original issue, I think that it is reductive to
classify "noexcept" as a matter of optimization:
if you use 'inline', or switch between -O0 and -O2 you can rely on the
fact that legal code will behave identically, except possibly for
runtime performance;
if you use 'noexcept' you are actually changing the behaviour of code.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 18 09:12AM -0700

On Saturday, March 18, 2017 at 10:11:26 AM UTC-4, bitrex wrote:
 
> <https://en.wikipedia.org/wiki/Cluster_B_personality_disorders>
 
> Even psychopaths have children from time to time. In what way should a
> child "honor" a psychopath?
 
God made each of us without all of the skills necessary to get by in
life. We all need each other to fill in the gaps, the shortcomings,
the weaknesses.
 
He built in us a community. This is what Christ teaches. He teaches
that He came to the Earth to bring division, not unity ... but everyone
that comes to Him is united in Him, such that the division is for
those still focused upon the Earth and the things of the Earth. When
we set our sights above onto Him, He brings us unity in our lives ...
but it comes with diligence and focus, purpose and passion. It is not
for idlers, but is for doers, and those who believe in what He's
given us so strongly that we are then teachers to everyone else in our
lives.
 
Thank you,
Rick C. Hodgin
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: