Friday, March 17, 2017

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

Ramine <toto@toto.net>: Mar 17 02:46PM -0400

Hello,
 
 
My C++ MemPool for real-time systems was updated to version 1.02
 
I have cleaned up more the code..
 
 
Description:
 
Real-Time Memory Management
 
In C++, memory management is normally performed using new,delete etc.
The run-time system's heap offers great flexibility and efficiency, but
it cannot fulfil real-time requirements. The run-time requirements are
non-deterministic. In addition, they may require blocking task switches,
which makes them unusable for interrupt handlers.
 
MemPool uses templates and offers memory management with real-time
capabilities through Memory Pools. A Memory Pool is an isolated heap
with data buffers as objects of equal size. Any number of memory pools
can exist simultaneously. A pool is initialized once and allocated a
certain number of buffers as objects. Thereafter, buffers as objects can
be allocated and deallocated from the pool under real-time conditions.
 
How to use it?
 
The parameters of the constructor are:
 
The first parameter is the number of items and the second parameter is a
boolean parameter that will tell MemPool to grow or not, if it is set
to true it will grow, set it to false for real-time systems, if you
don't pass any parameter, the number of items will be set to 200 and the
MemPool will not grow and thus it will be set for real-time systems.
 
The New() method returns a reference to the object, it's in O(1) time
complexity.
 
The Return() method returns the reference to the object to the stack, it
's in O(1) time complexity.
 
Please look at the test.cpp example to learn how to use MemPool.
 
Language: GNU C++ and Visual C++ and C++Builder
 
You can download my C++ MemPool for real-time systems from:
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
 
 
Thank you,
Amine Moulay Ramdane.
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 17 05:24PM

On 17/03/2017 12:28, David Brown wrote:
> persuasion is going to make them change their ways. With Thunderbird,
> you just press "K" to ignore the thread, or "shift-K" to ignore the
> sub-thread. Other newsreaders will have similar capabilities.
 
I find Christianity personally offensive; a technical newsgroup such as
this one is a lot like most workplaces: overt religiosity is banned
(because it is more trouble than it is worth) and if Rick preached where
I worked like he does in this newsgroup he wouldn't last long.
 
/Flibble
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 10:28AM -0700

Thanks a lot man. I will surely try to follow all the instructions that you mentioned above but could you please guide me about how do I follow usenet and how to use thunderbird and install it in linux?
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 10:54AM -0700

On Friday, March 17, 2017 at 1:24:58 PM UTC-4, Mr Flibble wrote:
> this one is a lot like most workplaces: overt religiosity is banned
> (because it is more trouble than it is worth) and if Rick preached where
> I worked like he does in this newsgroup he wouldn't last long.
 
Unless you repent and receive Jesus Christ as Lord and Savior, there is
soon coming a day when you will long with greatest longing to have one
more day to come back to the Earth and do exactly that.
 
Your entire future is at stake, Leigh.
 
It's why I post these messages ... because TODAY you have a chance to
be forgiven. TOMORROW is too late because none of us are promised
tomorrow.
 
-----
When you get the perspective (that we are accountable to God for our
sin), then you will realize why it is so important that we should not
only talk about Jesus Christ at church and in Bible Study and other
"religious" activities, but rather in all areas of our lives. This
is the Biblical teaching, and it is the one given us from God, and
it is the one by which we will be judged:
 
http://biblehub.com/ephesians/6-4.htm
4 And, ye fathers, provoke not your children to wrath: but bring
them up in the nurture and admonition of the Lord.
 
For those who have not had that upbringing, it is a requirement that
we teach them the gospel, as is commanded by the Lord:
 
http://biblehub.com/kjv/matthew/28.htm
18 And Jesus came and spake unto them, saying, All power is given
unto me in heaven and in earth.
19 Go ye therefore, and teach all nations, baptizing them in the
name of the Father, and of the Son, and of the Holy Ghost:
20 Teaching them to observe all things whatsoever I have commanded
you: and, lo, I am with you alway, even unto the end of the
world. Amen.
 
And here is the final word in the Bible regarding our futures:
 
http://biblehub.com/kjv/revelation/22.htm
10 And he saith unto me, Seal not the sayings of the prophecy of
this book: for the time is at hand.
11 He that is unjust, let him be unjust still: and he which is
filthy, let him be filthy still: and he that is righteous, let
him be righteous still: and he that is holy, let him be holy
still.
 
Verse 11 tells us not to force our religion on people as by outside
force, but only to teach them with words. If a person rejects it, we
have done our part and will not be held accountable for their blood.
 
12 And, behold, I come quickly; and my reward is with me, to give
every man according as his work shall be.
13 I am Alpha and Omega, the beginning and the end, the first and
the last.
 
14 Blessed are they that do his commandments, that they may have
right to the tree of life, and may enter in through the gates
into the city.
15 For without are dogs, and sorcerers, and whoremongers, and
murderers, and idolaters, and whosoever loveth and maketh a lie.
 
16 I Jesus have sent mine angel to testify unto you these things
in the churches. I am the root and the offspring of David, and
the bright and morning star.
 
And here is the culmination of the gift of life given to us by Jesus'
atoning death at the cross:
 
17 And the Spirit and the bride say, Come. And let him that heareth
say, Come. And let him that is athirst come. And whosoever will,
let him take the water of life freely.
 
The water of life freely ... eternal life.
 
Thank you,
Rick C. Hodgin
David Brown <david.brown@hesbynett.no>: Mar 17 07:32PM +0100

On 17/03/17 18:24, Mr Flibble wrote:
> this one is a lot like most workplaces: overt religiosity is banned
> (because it is more trouble than it is worth) and if Rick preached where
> I worked like he does in this newsgroup he wouldn't last long.
 
The key point about that is you find it /personally/ offensive - and I
am sure you have good reason for that attitude. I think most people
find Rick's religious posts annoying, but not offensive.
 
Brian finds posts with swearing to be "personally offensive" - yet most
of us, including you, have nothing against the occasional swear word if
it seems appropriate in the context.
 
It is always difficult to draw lines about what is "offensive" or
"immoral". I would complain about sexist, racist or homophobic remarks
- but usually ignore posts that are just annoying. Since it is
perfectly clear that every complaint about Rick's religious posts
provokes a new one, that is, I think, the only sensible strategy. The
same goes for your regular posts about how evolution "disproves"
Christianity - a claim that I think is ridiculous (even though I am not
religious, and I understand evolution as well as any interested layman).
Repeats of the same post are annoying, but there is no way to convince
you to stop, so I simply ignore those posts.
 
But of course your killfile is your own business - if you want to
killfile Rick or ignore his posts, that's fine. However, I am not
convinced it is the best general advice for others - they can make up
their own minds.
David Brown <david.brown@hesbynett.no>: Mar 17 07:36PM +0100

On 17/03/17 18:28, kushal bhattacharya wrote:
> instructions that you mentioned above but could you please guide
> me about how do I follow usenet and how to use thunderbird
> and install it in linux?
 
"apt-get install thunderbird", or use whatever package manager you have
for your distro. (If you are using Debian, it uses a different name for
Thunderbird because they feel that Mozilla's trademarks make it non-free
software. Google a little, and you will surely find a web page
explaining things.)
 
And you need a news account at a news server. I recommend going to
news.eternal-september.org - it's quite simple to register there, and
entirely free.
 
Again, Google is your friend for how to set up a news account in
Thunderbird - it's quite simple once you know where to look, and a
webpage will give more detail than is appropriate in a C++ newsgroup.
 
Also see Alf's recent post "How to simply not see certain postings, with
Thunderbird".
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Mar 17 06:41PM

On 17/03/2017 18:32, David Brown wrote:
> religious, and I understand evolution as well as any interested layman).
> Repeats of the same post are annoying, but there is no way to convince
> you to stop, so I simply ignore those posts.
 
My claim regarding evolution and Christ's existence isn't ridiculous at
all: evolution being a fact means Adam and Eve never existed which means
Adam and Eve's descendants AS DESCRIBED IN THE BIBLE also never existed.
 
> killfile Rick or ignore his posts, that's fine. However, I am not
> convinced it is the best general advice for others - they can make up
> their own minds.
 
Rick is in my killfile but people still reply to his posts and those
replies aren't blocked by my killfile.
 
/Flibble
Johann Klammer <klammerj@NOSPAM.a1.net>: Mar 17 04:57PM +0100

On 03/17/2017 02:22 AM, Alf P. Steinbach wrote:
> main menu choose "Message -> Create filter from message". Voila.
 
> Cheers & hth.,
 
> - Alf
So, if I click run on the filter, are those messages supposed to disappear?
coz that doesn't seem to happen...
 
what's the suggested action to use? delete?, ignore thread?
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 17 05:07PM +0100

On 17-Mar-17 4:57 PM, Johann Klammer wrote:
> So, if I click run on the filter, are those messages supposed to disappear?
> coz that doesn't seem to happen...
 
> what's the suggested action to use? delete?, ignore thread?
 
I just let the filter delete the messages.
 
I'm using a newly installed Thunderbird with no filters yet for clc++ so
I have no example rule to show.
 
 
Cheers!,
 
- Alf
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 10:19AM -0700

hi could you please tell me how do i do that in mozilla firefox in ubuntu environment
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 11:01AM -0700

On Friday, March 17, 2017 at 1:20:07 PM UTC-4, kushal bhattacharya wrote:
> hi could you please tell me how do i do that in mozilla firefox in ubuntu environment
 
You can install Thunderbird, and setup a free Eternal September Usenet
account, and then configure Thunderbird to retrieve content from the
Usenet groups you are interested in.
 
Using Thunderbird's filtering abilities, you can block entire threads,
people, keywords, etc.
 
Thank you,
Rick C. Hodgin
Ramine <toto@toto.net>: Mar 17 01:56PM -0400

Hello,
 
About C++ and real-time systems...
 
You have finally understood my way of coding real-time softwares..
 
I think that you have to simplify the code in real-time and realtime
critical systems, so i think that you have to use less code and verify
it effectively, this is what i have done
 
Please look at the following memory pools:
 
http://www.mario-konrad.ch/blog/programming/cpp-memory_pool.html
 
You will notice that the operations using the heap are of logarithmic
nature, so it's not as efficient as my C++ MemPool for real-time systems
that is O(1) in its operations, and that uses also templates and that
has an interface that is carefully designed to be easy to use and efficient.
 
My way of designing real-time softwares that works under QNX real-time
OS and VxWorks real-time OSs and other real-time OSs..
 
To be able to implement real-time softwares that control robots etc.
i have first implemented my C++ MemPool for real-time systems,
now it is easy to verify it by taking a look at its source code etc.
also i have provided you with a C++ threadpool that permits you
to code real-time softwares, it is easy to verify the source
code of this C++ threadpool and you will notice that it only
uses static arrays and it doesn't use dynamic memory and of
course it uses pthread , so it is portable to QNX real-time OS
and to VxWorks real-time OSs and to other real-time OSs,
also i will provide you with thread-safe bounded FIFO queue
for real-time systems and a thread-safe bounded LIFO stack for
real-time systems , and you will be able with all this to
code for real-time OSs and control robots etc.
 
You can download the C++ threadpool from here:
 
https://sites.google.com/site/aminer68/c-threadpool
 
And you can download my C++ MemPool for real-time systems from here:
 
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
Thank you,
Amine Moulay Ramdane.
Paavo Helde <myfirstname@osa.pri.ee>: Mar 17 04:49PM +0200

On 17.03.2017 9:52, kushal bhattacharya wrote:
> 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 ?
 
You have a bug in your multithread locking code. For example, a lock
might be missing in the code part which reads the deque.
Bonita Montero <Bonita.Montero@gmail.com>: Mar 17 04:27PM +0100

Am 17.03.2017 um 11:10 schrieb kushal bhattacharya:
> // break;
> }
> }
 
I'm not sure if I'm right, but afaik iterators are invalidated when you
erase() on a container.
 
--
http://facebook.com/bonita.montero/
David Brown <david.brown@hesbynett.no>: Mar 17 04:39PM +0100

On 17/03/17 16:27, Bonita Montero wrote:
>> }
 
> I'm not sure if I'm right, but afaik iterators are invalidated when you
> erase() on a container.
 
I believe you are correct there.
 
Certainly it is rarely a good idea to modify the variable you are
looping over from within the loop.
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 10:17AM -0700

actually i am using condition variable for notifying when there is any modification or addition done on the dequeue and on the reading side i am waiting by the condition variable to see if the deque is not emptyand accordingly within that lock on the condtion variable i am reading from the deque after i extracted the element from the deque i unlock the lock passed on the waiting condition variable
kushal bhattacharya <bhattacharya.kushal4@gmail.com>: Mar 17 10:48AM -0700

Hi,
Sorry if i didn't maintain any indentation or
any posting rules as such but from now on I am
trying to post it in a well formatted way.
Thanks,
Kushal
Ramine <toto@toto.net>: Mar 17 01:05PM -0400

Hello,
 
I have said that:
 
I have provided you with a C++ threadpool that permits you
to code real-time softwares, it is easy to verify the source
code of this C++ threadpool and you will notice that it only
uses static arrays and it doesn't use dynamic memory and of
course it uses pthread.
 
Please look at the Threadpool bounded queue size, it's at 10000,
so in real-time systems and in pratice it's easy to avoid blocking task
switches on the producer threads which makes it unusable for interrupt
handlers. To simplify, use for example one producer thread and don't go
beyond the size of the queue to be able to implement
real-time softwares under QNX real-time OS or VxWorks real-time OS etc.
 
You can download the C++ threadpool from here:
 
https://sites.google.com/site/aminer68/c-threadpool
 
And you can download my C++ MemPool for real-time systems from here:
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 17 12:48PM -0400

Hello,
 
I have said that:
 
I have provided you with a C++ threadpool that permits you
to code real-time softwares, it is easy to verify the source
code of this C++ threadpool and you will notice that it only
uses static arrays and it doesn't use dynamic memory and of
course it uses pthread.
 
Please look at the Threadpool bounded queue size, it's at 10000
so in real-time systems and in pratice it's easy to avoid a blocking
task switches on the producer threads which makes it unusable for
interrupt handlers. To simplify, use for example one producer thread and
don't go beyond the size of the queue to be able to implement
real-time softwares under QNX real-time OS or VxWorks real-time OS etc.
 
You can download the C++ threadpool from here:
 
https://sites.google.com/site/aminer68/c-threadpool
 
And you can download my C++ MemPool for real-time systems from here:
 
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 17 11:59AM -0400

Hello,
 
 
My way of designing real-time softwares that works under QNX real-time
OS and VxWorks real-time OSs and other real-time OSs..
 
To be able to implement real-time softwares that control robots etc.
i have first implemented my C++ MemPool for real-time systems,
now it is easy to verify it by taking a look at its source code etc.
also i have provided you with a C++ threadpool that permits you
to code real-time softwares, it is easy to verify the source
code of this C++ threadpool and you will notice that it only
uses static arrays and it doesn't use dynamic memory and of
course it uses pthread , so it is portable to QNX real-time OS
and to VxWorks real-time OSs and to other real-time OSs,
also i will provide you with thread-safe bounded FIFO queue
for real-time systems and a thread-safe bounded LIFO stack for
real-time systems , and you will be able with all this to
code for real-time OSs and control robots etc.
 
You can download the C++ threadpool from here:
 
https://sites.google.com/site/aminer68/c-threadpool
 
And you can download my C++ MemPool for real-time systems from here:
 
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
Thank you,
Amine Moulay Ramdane.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Mar 17 04:59PM +0100

On 17-Mar-17 3:45 PM, Paavo Helde wrote:
> compiler to elide any copy and move constructors, even if they have side
> effects. Any program whose semantics depend on these things called or
> not called is thus extremely fragile.
 
I think you misunderstand.
 
Manfred is not talking about the usual elision but about the
`std::vector`'s choice about what to call.
 
In short, the committee didn't have the guts to require move
constructors to be no-throw, and instead chose to make std::vector
unreliable, decidedly non-exception-safe in a certain case:
 
C++14 §23.3.6.3/3 about `reserve()`
"If an exception is thrown other than by the move constructor of a
non-CopyInsertable type, there are no effects"
 
Hidden in that innocuous wording, if an exception /is/ thrown from the
move constructor of a non-CopyInsertable type, then all bets are off.
 
To avoid this problem for a CopyInsertable type with possibly throwing
move constructor, a std::vector must copy items from its old buffer to
its new buffer, instead of moving. If an exception is thrown during
copying the old clean vector state can be reinstated (strong exception
guarantee). The quoted sentence guarantees this.
 
Thus it's not about a implementation-dependent optimization, but about
guaranteed, dependenable behavior, related to some dirtyness.
 
 
Cheers & hth.,
 
- Alf
Ramine <toto@toto.net>: Mar 17 11:06AM -0400

Hello...
 
 
C++ Threadpool
 
Description:
 
This C++ Threadpool is portable, and i think it can be used to code
real-time softwares under QNX real-time OS or VxWorks real-time OS and
other real-time OSs, because look at the source code it uses just static
arrays and it doesn't use dynamic memory and of course it uses pthread,
and i have included pthread for win32 and win64 inside the zip file,
 
You can use it also with my C++ MemPool for real-time systems here:
 
https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems
 
Please look at the example.cpp example to learn how to use this threadpool.
 
Language: GNU C++ and Visual C++ and C++Builder
 
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 17 11:08AM -0400

On 3/17/2017 11:06 AM, Ramine wrote:
 
> Thank you,
> Amine Moulay Ramdane.
 
I have made it compatible with GCC and with MSVC and with C++Builder.
 
 
Thank you,
Amine Moulay Ramdane.
Ramine <toto@toto.net>: Mar 17 11:19AM -0400

Hello...
 
You can download it from here:
 
https://sites.google.com/site/aminer68/c-threadpool
 
 
Thank you,
Amine Moulay Ramdane.
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Mar 17 08:31AM -0700

On Friday, March 17, 2017 at 11:20:05 AM UTC-4, Ramine wrote:
> Hello...
> You can download it from here:
> https://sites.google.com/site/aminer68/c-threadpool
 
Amine, given the volatile nature with which you change your life's
direction, and how you post writings which are incorrect, only to
then correct them moments later, and then a second re-correction a
few moments after that ... why do you expect anyone would trust your
code for their system?
 
I admire your willingness to share. I think you are creative and
very considerate of many things. But there is a line that is
crossed in your writing style which indicates your software code
is likely commensurately designed. That's a problem for a great
many people.
 
I would advise working toward greater stability in your authored
content ... both normal written posts, but also in the areas of
software reviews and design / alteration.
 
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: