- Learning modern C++, where to start? - 3 Updates
- if cargo blocks - 20 Updates
- atomic xchg based stack, for learning... - 1 Update
- A low overhead nanosecond timestamp reader in C++ for X86 Linux - 1 Update
"Öö Tiib" <ootiib@hot.ee>: Jan 07 11:25PM -0800 On Monday, 7 January 2019 17:51:30 UTC+2, Unto Sten wrote: > Regardless of the outcome, I think I am going to buy > Bjarne's book. And *if* the "Teach Yourself" is any good, > I just might get it too... You perhaps have already looked at that very popular Stack Overflow question: https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list The tastes vary but certainly the books that are mentioned there are worth reading. |
Manfred <noname@add.invalid>: Jan 08 02:09PM +0100 On 1/7/2019 11:44 PM, Jorgen Grahn wrote: > and learn to write good C++. IMO, the line between old and crufty C++ > and modern C++ is C++98, when the standard library containers appeared > and (years later) people started using them properly. This sounds a bit simplistic, I think. If C++98 was a major breakthrough, C++11 was somewhat of a major revision too. So, if one wishes to catch up today, I would recommend the 4th edition to start with. On top of this, a reasonable follow-up could be "Effective Modern C++" by Scott Meyers. >> But this C++ language seems to grow and grow, and >> new standards arrive frequently. I am pretty confused. I a no fan of ever-changing languages either. In fact I consider every change to the language a cost, which is not always paid off by the benefit of the new feature. More precisely, I do not agree with those who claim that a new feature is inexpensive if you don't want to use it - even if you don't use it, you need to know about it, and this is not cost-free. I agree with others that C++14 and C++17 are less big of a change wrt C++11. C++20 is probably going to be another major change, especially in the area of template metaprogramming, because of the introduction of template argument requirements (aka C++ "concepts" - btw poor choice of name IMVHO) Besides changes in the language, in the standard library there have been a lot of additions wrt C++98, like e.g. concurrency, resource management ({unique,shared,weak}_ptr etc.), traits, etc. which are worth knowing about. An overview can be found in https://en.cppreference.com/w/ with some indication of which C++ version introduced what. |
Daniel <danielaparker@gmail.com>: Jan 08 07:26AM -0800 On Tuesday, January 8, 2019 at 2:25:10 AM UTC-5, Öö Tiib wrote: > https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list > The tastes vary but certainly the books that are > mentioned there are worth reading. Just curious, does anyone here read the big tome books anymore, such as Lippman and Stroustrup? Does a book that purports to cover "just about everything in the language" have a place anymore? At one time, I had an early edition of Lippman on my shelf, which I used as a reference. But nobody needs a book as a reference anymore. cppreference performs that role admirably. As for programming techniques, take unicode. I did a search on unicode in my Stroustrup third edition, and find many sentences like "There are six kinds of character literals supporting Unicode" (Unicode literals.) This sounds excessive, but there are three major encodings of Unicode: UTF-8, UTF-16, and UTF-32. For each of these three alternatives, both raw and "ordinary" strings are supported." Etc. etc. etc. But nothing about emerging consensus in how to work with unicode in practical C++ applications. If I were recommending a book from the list, I would probably pick Koenig's Accelerated C++, mostly because it's shorter. Somebody learning C++ doesn't need an encyclopedia, for what reason would they want an encyclopedia? But unfortunately it doesn't look like it's ever been updated. Daniel |
queequeg@trust.no1 (Queequeg): Jan 08 12:20AM > i guess were unable to help to > this poor psyhopath... far too stupid Said fir, the smartest of the smartest. -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
gazelle@shell.xmission.com (Kenny McCormack): Jan 08 12:28AM In article <3a0eab39-cd46-4d3b-8ba2-973f601b6674@trust.no1>, >> i guess were unable to help to >> this poor psyhopath... far too stupid >Said fir, the smartest of the smartest. Compared to Ricky, fir is a fucking genius. -- The motto of the GOP "base": You can't *be* a billionaire, but at least you can vote like one. |
queequeg@trust.no1 (Queequeg): Jan 08 12:30AM > I have information you do not, Queequeg. Prove it, Rick. Produce a proof of your knowledge that will convince me that you indeed have this information and that this information is correct. Words are cheap, Rick. > If you are truth-seeking and are one of those being saved, God Himself > will confirm in your core that what I write is accurate, What if I am *NOT* seeking the truth, Rick? Are you able to accept that? > On that day, standing before Truth Himself, you will know why I did > what I did, even if you never understand it here on this Earth. Let me face it, then. Your God gave me free will for a reason, didn't He? It is my will to reject your truth unless you're able to prove it. > I will seek to lead them away from where they are in falseness, to the > place they need to be in truth. If you were able to, would you do it by (physical) force? > It is what God calls every Christian to do. How do you know that? Did God tell you this himself, Rick? -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Jan 07 04:37PM -0800 On 1/7/2019 4:30 PM, Queequeg wrote: >> I will seek to lead them away from where they are in falseness, to the >> place they need to be in truth. > If you were able to, would you do it by (physical) force? He did say he wanted to grab me by the ears and shake my head back and forth screaming "wake up" into my face. The post is hard to find. Will try to find it. I asked him if it was a threat. He said something like this is what God would do to you. |
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Jan 07 04:39PM -0800 On 1/7/2019 4:37 PM, Chris M. Thomasson wrote: >> If you were able to, would you do it by (physical) force? > He did say he wanted to grab me by the ears and shake my head back and > forth screaming "wake up" into my face. Rick has to remember writing this. |
queequeg@trust.no1 (Queequeg): Jan 08 12:47AM >>Said fir, the smartest of the smartest. > Compared to Ricky, fir is a fucking genius. I'd say it's the other way around. Rick is delusional and fanatic, but certainly not stupid. I know others like Rick. Something in their past made them live in a distorted reality, but it doesn't have to go in pair with intellectual impairment. fir, on the other hand... just read his posts. He's primitive and openly aggressive. Nothing he ever posted made any sense, it's just toxic junk. Even proper quoting and spelling is beyond his intellectual capabilities, yet his arrogance is overwhelming. -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
fir <profesor.fir@gmail.com>: Jan 07 04:53PM -0800 W dniu poniedziałek, 7 stycznia 2019 23:59:26 UTC+1 użytkownik Mr Flibble napisał: > > lake of fire. > > It's important. Please consider these things. > It's important. Please consider how so full of shit you actually are. its rather not dik is full of fecalia but rather he covers his surrounding in that, his surrounding is full of fecalia.. that crap is his gift.. only value i see is that dik teaches people how to treat imbeciles, and how it looks like when you contacts with imbecile - but its so damn hard and unpleasant lessons.. dick stupidity bends reality and instead of talking on some clever things youre stickin in deep sh*t i would put ramine chang and dik into separate group not allowing them to vrite outside (sorta usenet jail for usenet bandits) and that would be fun if thay would discuss with themselves there (i know it is like medevial but all that topics warped by disk stupidity cannot be treaten to much seriously its like parody of implied imbecilism) |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 07 05:01PM -0800 On Monday, January 7, 2019 at 7:30:37 PM UTC-5, Queequeg wrote: > Rick C. Hodgin <rick.c.hodgin@gmail.com> wrote: > > I have information you do not, Queequeg. > Prove it, Rick. It's not my job to prove it to you. That's the work of the Holy Spirit. Before it happened to me in 2004, and I'm talking minutes before, I would not have believed the transformation was possible, and would've argued with someone like me that they were nuts. It's all the flesh can do because Jesus brings new life, and until that life arrives, only the old way of thinking and perceiving everything exists. -- Rick C. Hodgin |
fir <profesor.fir@gmail.com>: Jan 07 05:01PM -0800 W dniu wtorek, 8 stycznia 2019 01:53:20 UTC+1 użytkownik fir napisał: >like parody of implied imbecilism) by implied i probably meant more like imposed, overlayed (weak english, i may mistake some words) |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 07 05:19PM -0800 On Monday, January 7, 2019 at 7:39:18 PM UTC-5, Chris M. Thomasson wrote: > > He did say he wanted to grab me by the ears and shake my head back and > > forth screaming "wake up" into my face. > Rick has to remember writing this. It was to wake you up out of your complacency, the way a parent would grab their disobedient child and get their attention. You have taken flippancy to a zen level, Chris. It's to the point where I'm going to stop commenting on it because until you seek to change from the inside, it will never happen from any outside prompting. -- Rick C. Hodgin |
fir <profesor.fir@gmail.com>: Jan 07 05:23PM -0800 W dniu wtorek, 8 stycznia 2019 02:01:19 UTC+1 użytkownik Rick C. Hodgin napisał: > It's all the flesh can do because Jesus brings new life, and until that > life arrives, only the old way of thinking and perceiving everything > exists. to be honest rick this transwormation was a type as x -> shit i mean that transformation wasnt so much great |
queequeg@trust.no1 (Queequeg): Jan 08 01:31AM >> > I have information you do not, Queequeg. >> Prove it, Rick. > It's not my job to prove it to you. Then how can I take your words seriously if they're not backed up by evidence? > That's the work of the Holy Spirit. Then what's the point in your teachings, Rick? If the Holy Spirit decides to transform me, then no teachings will be necessary for me to understand the truth, am I right? > Before it happened to me in 2004, and I'm talking minutes before, I > would not have believed the transformation was possible, and would've > argued with someone like me that they were nuts. What exactly happened to you in 2004 that transformed you, Rick? -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
queequeg@trust.no1 (Queequeg): Jan 08 01:33AM > It was to wake you up out of your complacency, the way a parent > would grab their disobedient child and get their attention. What if someone self-righteous did the same to you, Rick? What would you think of him and his behavior? -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
gazelle@shell.xmission.com (Kenny McCormack): Jan 08 03:03AM In article <a1a15d53-5388-4bd4-94d1-4af56f3697c8@trust.no1>, >>>Said fir, the smartest of the smartest. >> Compared to Ricky, fir is a fucking genius. >I'd say it's the other way around. As that great philosopher Forest Gump said... -- http://www.rollingstone.com/politics/news/the-10-dumbest-things-ever-said-about-global-warming-20130619 |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 07 07:06PM -0800 On Monday, January 7, 2019 at 8:31:34 PM UTC-5, Queequeg wrote: > > It's not my job to prove it to you. > Then how can I take your words seriously if they're not backed up by > evidence? They are backed up by evidence, but I can't convince you of it. It is literally an act of God to draw someone to His Son, because it requires a movement of the spirit, and that's something only God can give you. I've told you the reasons why in this thread. You are unable to hear them. If you ever set your sights on the truth, they will begin to make sense to you. Right now you're still in "You're wrong, Rick!" mode, which prevents you from hearing the truth. You keep yourself away from it by your self-beliefs. -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 07 07:07PM -0800 On Monday, January 7, 2019 at 8:33:41 PM UTC-5, Queequeg wrote: > > would grab their disobedient child and get their attention. > What if someone self-righteous did the same to you, Rick? What would you > think of him and his behavior? I would never do it to Chris or anybody else. But his lackadaisical attitude prompts me to recognize it would be an appropriate response by certain individuals. -- Rick C. Hodgin |
queequeg@trust.no1 (Queequeg): Jan 08 09:31AM > They are backed up by evidence, but I can't convince you of it. If you can't convince me, then there's no evidence. "Evidence" has the same root as "evident". Evidence should be unambiguous and evident. > It is literally an act of God to draw someone to His Son, because > it requires a movement of the spirit, and that's something only > God can give you. If only God can give it to me, then why are you preaching your truth? If God decides that I'm worthy of His grace, He will tell me that Himself. > Right now you're still in "You're wrong, Rick!" mode, which prevents you > from hearing the truth. The problem is that you're not here to discuss, Rick. You're here to preach, unwilling to listen. Why then should I listen to you? Instead of speaking from a position of equality, you put yourself in a position of authority, yet providing nothing to back up your authoritarian stance. You're proudly considering yourself a messenger of God. Remember that pride is one of seven deadly sins, Rick. -- https://www.youtube.com/watch?v=9lSzL1DqQn0 |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 08 03:47AM -0800 On Tuesday, January 8, 2019 at 4:31:38 AM UTC-5, Queequeg wrote: > > it requires a movement of the spirit, and that's something only > > God can give you. > [snip] Salvation is available to everyone, but not everyone will be saved. If you are concerned about your eternal soul, seek the truth. Seek to learn if God is who the Bible claims He is. Seek to gain a true understanding of scripture to learn if you are justified un receiving Him or rejecting Him. The truth will make you free (from the yoke and bondage of sin, from judgment, condemnation, and the punishment doled out to an eternal being -- you). Eternity is before each of you. Jesus is the only way to be saved because of what He did at the cross. I implore you ... DON'T TAKE MY WORD FOR IT!!! Go directly to the Bible AND READ FOR YOURSELF. Put all of my claims to the test. Seek to learn what the Bible teaches, so as to truly understand its teachings. Set out to see if what you currently personally believe about Jesus is true or not by comparing your beliefs to what's written. God will not fail you. -- Rick C. Hodgin |
"Rick C. Hodgin" <rick.c.hodgin@gmail.com>: Jan 08 04:57AM -0800 This came across my Twitter feed today: If you are looking for proof God is real, you do not have faith. Without faith, God will never reveal Himself to you. John 20:29 "(KJV) Jesus saith unto him, Thomas, because thou hast seen me, thou hast believed: blessed are they that have not seen, and yet have believed." -- Rick C. Hodgin |
gazelle@shell.xmission.com (Kenny McCormack): Jan 08 01:42PM In article <139d7632-db59-4cd7-beb6-853edd80f691@googlegroups.com>, Rick C. Hodgin <rick.c.hodgin@gmail.com> wasted everybody's time as usual: (snip) -- The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL: http://user.xmission.com/~gazelle/Sigs/Windows |
"Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid>: Jan 08 12:20AM -0800 On 12/28/2018 11:30 PM, Chris M. Thomasson wrote: > Here is the original link: > https://groups.google.com/d/topic/lock-free/wwsAmcuAefA/discussion [...] Fwiw, I coded up a distributed table version in a Relacy test unit: ____________________ // Simple Atomic Stack // Distributed with a Table // For Academic and Experimental things... // Beginner, Moderate? // In Good Ol' Relacy! Nice as always. //_______________________________________________ //#define RL_DEBUGBREAK_ON_ASSERT //#define RL_MSVC_OUTPUT //#define RL_FORCE_SEQ_CST //#define RL_GC #include <relacy/relacy_std.hpp> #include <iostream> // Simple macro based redirection of the verbose std membars. #define CT_MB_ACQ std::memory_order_acquire #define CT_MB_REL std::memory_order_release #define CT_MB_RLX std::memory_order_relaxed #define CT_MB_ACQ_REL std::memory_order_acq_rel #define CT_MB_SEQ_CST std::memory_order_seq_cst #define CT_MB(mp_0) std::atomic_thread_fence(mp_0) // Some global vars directing the show... #define PRODUCERS 4 #define CONSUMERS 2 #define THREADS (PRODUCERS + CONSUMERS) #define ITERS 5 #define TABLE_SZ 2 // Experimental Stack struct ct_ecstack { #define WAITNEXT ((node*)0xDEADBEEF) struct node { std::atomic<node*> m_next; VAR_T(unsigned int) m_data; node(unsigned int data) : m_next(nullptr), m_data(data) {} void process() { // simulate some work? rl::yield(1 + rl::rand(2), $); // ;^) unsigned long tid = rl::thread_index(); unsigned long wid = VAR(m_data); RL_ASSERT(tid != wid); } node* next_wait() { node* next = nullptr; while ((next = m_next.load(CT_MB_RLX)) == WAITNEXT) { // Humm, we can actually do other work right here... // Hand off... rl::yield(1, $); } return next; } }; std::atomic<node*> m_head; ct_ecstack() : m_head(nullptr) {} void push(node* n) { n->m_next.store(WAITNEXT, CT_MB_RLX); node* head = m_head.exchange(n, CT_MB_REL); // release n->m_next.store(head, CT_MB_RLX); } node* flush_try() { return m_head.exchange(nullptr, CT_MB_ACQ); // acquire } }; // Easy Stack Table struct ct_estable { ct_ecstack m_buffer[TABLE_SZ]; ct_ecstack& hash(unsigned long tid) { return m_buffer[tid % TABLE_SZ]; } }; #define CT_STOP (PRODUCERS * ITERS) // Relacy Stack Test... struct ct_ecstack_test : rl::test_suite<ct_ecstack_test, THREADS> { ct_estable g_estable; unsigned long g_contrived_stop; void before() { g_contrived_stop = 0; } void after() { RL_ASSERT(g_contrived_stop == CT_STOP); } unsigned long process_stack(ct_ecstack& stack) { unsigned long count = 0; ct_ecstack::node* n = stack.flush_try(); // flush all while (n) { // Process n first, acts like a backoff for the next wait // Hand off some other nodes? Future note... n->process(); // Wait for the next pointer, or hand off? ct_ecstack::node* next = n->next_wait(); if (next) { int g = 0; } // Destroy delete n; // Loop on... n = next; ++count; } return count; } unsigned long process() { unsigned long tid = rl::thread_index(); unsigned long count = 0; for (unsigned long i = 0; i < TABLE_SZ; ++i) { count = process_stack(g_estable.m_buffer[(tid + i) % TABLE_SZ]); if (count > 0) { break; } int g = 0; } return count; } void consumer(unsigned int tidx) { while (g_contrived_stop != CT_STOP) { unsigned long count = process(); if (! count) rl::yield(1, $); g_contrived_stop += count; } } void producer(unsigned int tidx) { ct_ecstack& stack = g_estable.m_buffer[tidx % TABLE_SZ]; for (unsigned long i = 0; i < ITERS; ++i) { stack.push(new ct_ecstack::node(tidx)); } // g_contrived_stop += process(); } void thread(unsigned int tidx) { if (tidx < PRODUCERS) { producer(tidx); } else { consumer(tidx); } } }; // Test away... Or fly? Humm... int main() { { rl::test_params p; p.iteration_count = 10000000; //p.execution_depth_limit = 33333; //p.search_type = rl::sched_bound; //p.search_type = rl::fair_full_search_scheduler_type; //p.search_type = rl::fair_context_bound_scheduler_type; rl::simulate<ct_ecstack_test>(p); } return 0; } ____________________ This is a different style of setup wrt the original code where each thread can take on the role of a producer or a consumer. In this unit test I am modeling a _strict_ producer to consumer relationship, where a producer never consumes, and vice versa. It forces 100% foreign processing because a producer can never consume its own work. I know this is bad, but I just wanted to code one up for fun. Works like a charm. Should have some C++11 code soon. |
raomeng1@gmail.com: Jan 07 07:08PM -0800 Hi, I've created a simple C++ nanosecond timestamp reader class based on TSC, which can replace the use of clock_gettime()/chrono::high_resolution_clock::now() because it's much more efficient and stable in terms of latency: in around 10 ns for getting a ns timestamp. Also it can sync up exactly with kernel tsc freqency by cheating. The project is https://github.com/MengRao/tscns. Thanks for giving advice. Regards, Meng |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment