- Pointer use after delete - 4 Updates
- Machine code!!! \o/ - 14 Updates
- std::condition_variable::wait_for - 4 Updates
"Öö Tiib" <ootiib@hot.ee>: Sep 02 02:18PM -0700 On Wednesday, 2 September 2015 03:48:38 UTC+3, Richard Damon wrote: > (presumably allowing immediate termination without any stack unwinding > or cleanup). This sort of behavior is normally only the domain of > undefined behavior. The non-normative footnotes are just to illustrate and clarify the meaning of standard. I would like the standard to define traits on each case of "implementation defined" behavior or at least macros like 'COPYABLE_BAD_POINTERS', 'COMPARABLE_BAD_POINTERS' etc. Otherwise they always take some exotic platform that did never have C++ compiler as excuse of defining nothing and keeping C++ non-portable. |
Louis Krupp <lkrupp@nospam.pssw.com.invalid>: Sep 02 03:49PM -0600 On Tue, 1 Sep 2015 19:11:55 +0000 (UTC), >>be a capability (burroughs B5500) or it could be an offset from >>the stack pointer (HP-3000). >How many people under the age of 30 have even *heard* of Burroughs? FWIW, the Burroughs Large Systems architecture survives in a Unisys product line. Not that too many people under 30 (or even over 30) have paid much attention to Unisys... Louis |
Bo Persson <bop@gmb.dk>: Sep 03 12:26AM +0200 On 2015-09-02 23:18, Öö Tiib wrote: > Otherwise they always take some exotic platform that did > never have C++ compiler as excuse of defining nothing and > keeping C++ non-portable. You know that one of these "exotic" systems was 16-bit Windows with far pointers. A deallocated segment could have its descriptor table entry removed, causing a trap if loaded into a segment register. Otherwise agree that we could use a feature test macro, like __cpp_traps_invalid_pointers, and put that in a static_assert. Just to be sure. Bo Persson |
mark <mark@invalid.invalid>: Sep 03 01:13AM +0200 On 2015-09-03 00:26, Bo Persson wrote: > You know that one of these "exotic" systems was 16-bit Windows with far > pointers. A deallocated segment could have its descriptor table entry > removed, causing a trap if loaded into a segment register. Nice example. It wouldn't even be possible to convert the pointer to uintptr_t, if the segment were deallocated. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 07:22PM +0100 On 02/09/2015 06:53, Gareth Owen wrote: >> As Adam never existed Adam's descendants as described in >> the Bible also never existed ergo Jesus Christ never existed. > Formal logic is not really a strength of yours is it? Nothing wrong with my logic mate. /Flibble |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 07:23PM +0100 On 02/09/2015 08:17, Marcel Mueller wrote: > symbols. The entry point is sometimes named _main internally (or > something else) and so it won't link. > So what should be the use of a hack like this? The primary use of a hack like this is that it is an excuse to use the wavy arms emoticon, \o/. /Flibble |
bartekltg <bartekltg@gmail.com>: Sep 02 08:58PM +0200 On 02.09.2015 20:22, Mr Flibble wrote: >>> the Bible also never existed ergo Jesus Christ never existed. >> Formal logic is not really a strength of yours is it? > Nothing wrong with my logicmate. As King Arthur never existed*), Arthur's descendants, as described in the Royal Archives**), also never existed, ergo Queen Elizabeth II do not exist. I'm not sure, I have nothing to do with UK, but it looks like quite a big conspiracy is going on. *) https://en.wikipedia.org/wiki/King_Arthur#Debated_historicity Too many candidates, and none of them talk with magic creatures, impostors! **) https://childrenofarthur.wordpress.com/tag/british-royal-family/ bartekltg |
Gareth Owen <gwowen@gmail.com>: Sep 02 08:29PM +0100 >>> the Bible also never existed ergo Jesus Christ never existed. >> Formal logic is not really a strength of yours is it? > Nothing wrong with my logic mate. So if I can find a history book that gets the genealogy of Henry VIII wrong, that proves that Henry VIII didn't exist? There's masses of evidence of Jesus Christ - albeit much less of his supposed divinity. Errors in the Bible don't invalidate subsequent parts of the Bible. Any rational atheist should be able to figure that out. |
Gareth Owen <gwowen@gmail.com>: Sep 02 08:29PM +0100 > As King Arthur never existed*), Arthur's descendants, as described in > the Royal Archives**), also never existed, ergo Queen Elizabeth II > do not exist. Nice example. |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 08:34PM +0100 On 02/09/2015 19:58, bartekltg wrote: > As King Arthur never existed*), Arthur's descendants, as described in > the Royal Archives**), also never existed, ergo Queen Elizabeth II > do not exist. False analogy; you could extend that to say that if Adam never existed then the entire human race doesn't exist and this is of course absurd; the human race AS DEPICTED IN THE BIBLE never existed. Jesus Christ OF THE BIBLE never existed; some guy that this FICTIONAL CHARACTER might have been partially based on might have existed but this guy and Jesus Christ ARE NOT THE SAME INDIVIDUAL. None of the characters of the Old Testament ever existed because, according to the Old Testament, they were all related to Adam. I can simplify it further for you: If Adam never existed then Adam's children never existed. Have you read the Watchmen comics? They have an alternate timeline with a fictional President Nixon who never resigned; this FICTIONAL President Nixon and the real President Nixon ARE NOT THE SAME INDIVIDUAL. Get it now? Nothing wrong with my logic if you understand logic. /Flibble |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 08:39PM +0100 On 02/09/2015 20:29, Gareth Owen wrote: >> Nothing wrong with my logic mate. > So if I can find a history book that gets the genealogy of Henry VIII > wrong, that proves that Henry VIII didn't exist? False analogy. There are multiple sources which describe the true genealogy of that person and we have evidence other than written evidence of same. > supposed divinity. Errors in the Bible don't invalidate subsequent > parts of the Bible. Any rational atheist should be able to figure that > out. There is absolutely no evidence contemporary to Jesus Christ's supposed life; all the "evidence" was written much later after he had supposedly died. Christianity is predicted on Jesus having existed and the Bible being true; Christianity is false. /Flibble |
Gareth Owen <gwowen@gmail.com>: Sep 02 09:10PM +0100 > There is absolutely no evidence contemporary to Jesus Christ's > supposed life; all the "evidence" was written much later after he had > supposedly died. Demonstrably untrue. At least some of the Pauline Epistles are almost certainly written by his contemporaries, as is the Gospel of Mark. > Christianity is predicted on Jesus having existed Which everyone who actually knows what they're talking about believes he did. Which doesn't make Christianity true - that would be a logical leap every bit as incompetent as the one you make. |
bartekltg <bartekltg@gmail.com>: Sep 02 11:04PM +0200 On 02.09.2015 21:34, Mr Flibble wrote: >> the Royal Archives**), also never existed, ergo Queen Elizabeth II >> do not exist. > False analogy; Nothing wrong with my analogy. Checkmate. > you could extend that to say that if Adam never existed > then the entire human race doesn't exist and this is of course absurd; I'm glad you know that;-) > Jesus Christ OF THE BIBLE never existed; some guy that this FICTIONAL > CHARACTER might have been partially based on might have existed but this > guy and Jesus Christ ARE NOT THE SAME INDIVIDUAL. I don't know, and I don't care about discussion about existence of Jesus, percentage of biblical Jesus in Jesus and his connection to Brian and his life. I wanted only to address you statement about Adam and Jesus. It is not an implication, regardless if Jesus existed or not. (OK, in formal logic, p=>q is true for p and q false, but a sentence "quantum mechanic is about dogs, so Earth is a cube" is not true for most people:) There is a couple of religion, where Jesus is real, and Adam is metaphorical. Catholics for example. > None of the characters of the Old Testament ever existed because, No one? https://en.wikipedia.org/wiki/List_of_biblical_figures_identified_in_extra-biblical_sources#Hebrew_Bible_.28Old_Testament.29 As we speak about holy texts: "Only sith deal in absolutes". > according to the Old Testament, they were all related to Adam. I can > simplify it further for you: If Adam never existed then Adam's children > never existed. But this is the same mistake. If connection between Queen and Arthur is too abstract. The first historic ruler of Poland was Mieszko. He was real, his family rule until XIV century. But there is a couple of medieval books mentioning his ancestors, including Piast (this is also the family name). But Piast propably didn't exist, (no one really know). So his (grand)^3 son didn't exist too? No, If Piast is fictional, Mieszko's grand^3 father was just someone else. Two characters from a old book. Related. One real, one not. > Have you read the Watchmen comics? They have an alternate timeline with No. The movie is enough? ;> > a fictional President Nixon who never resigned; this FICTIONAL President > Nixon and the real President Nixon ARE NOT THE SAME INDIVIDUAL. This is subtle difference and your mistake is that, we know the Watchmen is a work of fiction. If you know that Bible is a pure fiction, then you do nod need a futher proof. If you don't know that, or speak with somebody who thinks different, your 'prof' doesn't work. You concluded Jesus's non-existence from an assumption about Billie, not from Adam's non-existence. > Get it now? I understand your way of thinking. > Nothing wrong with my logic if you understand logic. This sentence is bellyful. In order to understand recursion, you must first understand recursion. I'm sorry about offtopic, I try to stop. bartekltg |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 10:09PM +0100 On 02/09/2015 22:04, bartekltg wrote: > > Nothing wrong with my logic if you understand logic. > This sentence is bellyful. > In order to understand recursion, you must first understand recursion. Oh I understand recursion all right: Christianity is predicated on the New Testament being true and the New Testament is predicated on the Old Testament being true. I repeat: there is nothing wrong with my logic. /Flibble |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 10:12PM +0100 On 02/09/2015 21:10, Gareth Owen wrote: >> supposedly died. > Demonstrably untrue. At least some of the Pauline Epistles are almost > certainly written by his contemporaries, as is the Gospel of Mark. Nonsense; the Gospels will written sometime after the supposed death of Jesus Christ. There is absolutely no contemporary evidence, none. > Which everyone who actually knows what they're talking about believes he > did. Which doesn't make Christianity true - that would be a logical > leap every bit as incompetent as the one you make. Do you often try to put words in other people's mouths mate? My logic is sound. /Flibble |
Gareth Owen <gwowen@gmail.com>: Sep 02 11:26PM +0100 >> leap every bit as incompetent as the one you make. > Do you often try to put words in other people's mouths mate? My logic > is sound. You're an idiot. *plonk* |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Sep 02 11:32PM +0100 On 02/09/2015 23:26, Gareth Owen wrote: >> Do you often try to put words in other people's mouths mate? My logic >> is sound. > You're an idiot. *plonk* That would be an attack on the person rather than on the argument, a logical fallacy, idiot. /Flibble |
Christopher Pisz <nospam@notanaddress.com>: Sep 02 06:04PM -0500 On 9/2/2015 5:26 PM, Gareth Owen wrote: >> Do you often try to put words in other people's mouths mate? My logic >> is sound. > You're an idiot. *plonk* Flibble is a troll. Ignore him or invite him to alt.atheist |
Christopher Pisz <nospam@notanaddress.com>: Sep 02 10:15AM -0500 On 9/2/2015 5:20 AM, Chris Vine wrote: > all threads share the m_stopCV and m_stopMutex objects, because at > present only one thread will run its task at a time. But that is > easily resolved. They appear to be running in parallel according to the log. They certainly aren't going one every ten seconds. I'll try with a longer task. If that is a problem, how do we easily solve it? > condition_variable::wait_until() with a separate time_point object for > the thread, which you reset by a further 10 seconds at each firing. > Chris Yea, I realized that. I'll do some kind of time arithmetic from start of task to end. Log: 2015-09-01 18:05:48.144017|ThreadedOngoingTask #9 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #7 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #6 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #5 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #3 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #2 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #8 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #1 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #4 tick... 2015-09-01 18:05:48.144017|ThreadedOngoingTask #0 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #0 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #4 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #3 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #2 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #1 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #7 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #6 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #8 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #5 tick... 2015-09-01 18:05:58.149118|ThreadedOngoingTask #9 tick... -- I have chosen to troll filter/ignore all subthreads containing the words: "Rick C. Hodgins", "Flibble", and "Islam" So, I won't be able to see or respond to any such messages --- |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Sep 02 05:06PM +0100 On Wed, 02 Sep 2015 10:15:37 -0500 Christopher Pisz <nospam@notanaddress.com> wrote: [snip] > certainly aren't going one every ten seconds. I'll try with a longer > task. > If that is a problem, how do we easily solve it? [snip] > 2015-09-01 18:05:58.149118|ThreadedOngoingTask #8 tick... > 2015-09-01 18:05:58.149118|ThreadedOngoingTask #5 tick... > 2015-09-01 18:05:58.149118|ThreadedOngoingTask #9 tick... This tells you nothing. To "prove" that the tasks are running concurrently you would have to have two interleaved log lines, which your logger probably prevents anyway (I haven't looked at it). Look at the while loop in the ThreadedOngoingTask::ThreadProcedure() method, look at the state of m_stopMutex there (put in some debugging code which reports on the value returned by std::unique_lock::owns_lock() in the loop at the point where you call the logger, which I assume substitutes in your test case for "doing something" in the worker thread, and then it should be obvious what the problem is and what to do, namely call std::unique_lock::unlock() and std::unique_lock::lock() at the appropriate places. This assumes that m_stopMutex and m_stopCV are shared by all worker threads. Chris |
Christopher Pisz <nospam@notanaddress.com>: Sep 02 12:07PM -0500 On 9/2/2015 11:06 AM, Chris Vine wrote: > std::unique_lock::lock() at the appropriate places. This assumes that > m_stopMutex and m_stopCV are shared by all worker threads. > Chris Ah, I see. Thanks for catching that. So, I something like this, is OK? // Do not allow exceptions to escape the thread try { // Loop forever until signalled to exit std::unique_lock<std::mutex> lock(m_stopMutex); while(!m_stopCV.wait_for(lock, std::chrono::seconds(10), [this](){return m_stop;}) ) { // Unlock such that other worker threads can run thier tasks lock.unlock(); // Do the work std::ostringstream msg; msg << "ThreadedOngoingTask #" << m_id << " tick...Owns Lock: " << lock.owns_lock(); Shared::Logger::getInstance()->logExecutionEvent(msg.str(), __FILE__, __LINE__, Shared::DateTime(), Shared::Logger::LoggingLevel::LOG_LEVEL_DEBUG); // Lock for the next while condition check lock.lock(); } } catch(...) { std::ostringstream msg; msg << "An unhandled exception occured in thread of ThreadedOngoingTask #" << m_id << ". Stopping thread."; Shared::Logger::getInstance()->logExecutionEvent(msg.str(), __FILE__, __LINE__, Shared::DateTime(), Shared::Logger::LoggingLevel::LOG_LEVEL_DEBUG); } |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Sep 02 06:58PM +0100 On Wed, 02 Sep 2015 12:07:18 -0500 > __FILE__, __LINE__, Shared::DateTime(), > Shared::Logger::LoggingLevel::LOG_LEVEL_DEBUG); > } That looks fine. Chris |
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