Saturday, February 24, 2024

Fwd: 健康

>
> 
>>
>> 
>>

Monday, February 19, 2024

Digest for comp.lang.c++@googlegroups.com - 2 updates in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 19 06:50AM +0100

Am 18.02.2024 um 21:13 schrieb Chris M. Thomasson:
 
>> ... without any problems.
 
>> For me lock_guard doesn't make sense.
 
> It has its purpose. ...
 
... which unique_lock also fulfills.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 19 11:56AM -0800

On 2/18/2024 9:50 PM, Bonita Montero wrote:
 
>>> For me lock_guard doesn't make sense.
 
>> It has its purpose. ...
 
> ... which unique_lock also fulfills.
 
lock_guard is highly restricted when compared to unique_lock... ;^)
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.

Sunday, February 18, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 1 topic

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 17 03:40PM -0800

On 2/17/2024 11:15 AM, Bonita Montero wrote:
> Why is there lock_guard when unique_lock can anything lock_guard
> can do but far more ?
 
lock_guard is meant for its purpose. Only use unique_lock when you need
to. And be careful, you can shoot yourself in the foot with it...
Bonita Montero <Bonita.Montero@gmail.com>: Feb 18 07:59AM +0100

Am 18.02.2024 um 00:40 schrieb Chris M. Thomasson:
>> Why is there lock_guard when unique_lock can anything lock_guard
>> can do but far more ?
 
> lock_guard is meant for its purpose. ...
 
You easily could do ...
 
template<typename Lock>
using std::lock_guard = std::unique_lock<Lock>;
 
... without any problems.
 
For me lock_guard doesn't make sense.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 18 12:13PM -0800

On 2/17/2024 10:59 PM, Bonita Montero wrote:
>     using std::lock_guard = std::unique_lock<Lock>;
 
> ... without any problems.
 
> For me lock_guard doesn't make sense.
 
It has its purpose. If you did this then std::lock_guard would be
moveable even though its not meant to be. That's just one point...
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.

Saturday, February 17, 2024

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 17 08:15PM +0100

Why is there lock_guard when unique_lock can anything lock_guard
can do but far more ?
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.

Friday, February 16, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 2 topics

Tim Rentsch <tr.17687@z991.linuxsc.com>: Feb 16 08:06AM -0800


> I was implementing a version of that when something else occurred to
> me. You can sacrifice speed for store size if you're prepared to do an
> integer divide for every prime lookup.
 
I explained before how numbers can be considered mod 30, of which
only the residues { 1, 7, 11, 13, 17, 19, 23, 29 } are candidates,
because all other residues are divisible by 2, 3, or 5. And very
conveniently, there are exactly 8 of these residues, so one byte
can be used to represent each block of 30 numbers (only 8 of which
might be prime). That cuts down on the space needed.
 
I also explained how the divides and remainders can be avoided,
by taking advantage of the structure of how the numbers being
considered are represented, and arranging that the difficult parts
be done at compile time.
 
I have an implementation (written in C) based on this approach that
determines all primes less than roughly 51.75 billion, taking just
under 56 seconds to complete. (No threading is used - code is all
single threaded.)
 
> operator[]. (certainly not the at function). And also I found myself
> using emplace_back a lot. It's a PITA because you can only emplace
> back a single item, and it is slow.
 
My program is written in C and uses ordinary C arrays. I expect it
could be converted to C++ without too much difficulty.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 16 06:30PM +0100

Am 16.02.2024 um 17:06 schrieb Tim Rentsch:
 
> determines all primes less than roughly 51.75 billion, taking just
> under 56 seconds to complete. (No threading is used - code is all
> single threaded.)
 
On my 16 core PC this takes 1.73 seconds and 43 seconds
overall CPU time without printing the numbers to a file.
 
C:\Users\Boni\Documents\Source\bitmapSieve>timep
"x64\Release-clang++\bitmapSieve.exe" 51750000000 ""
real 1.729s
user 43.094s
sys 0.094s
cylces 194.738.953.589
Bonita Montero <Bonita.Montero@gmail.com>: Feb 16 09:17AM +0100

Am 15.02.2024 um 23:11 schrieb Paavo Helde:
 
> Constructing and copying std::strings is allowed to allocate dynamic
> memory. Make your string a bit longer and you will see allocations
> also in Release builds.
 
The small string optimization is nothing which is guaranteed.
Initializing a function object with a reference_wrapper is
guaranteed to be without memory allocation.
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.

Thursday, February 15, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 1 topic

Paavo Helde <eesnimi@osa.pri.ee>: Feb 15 03:34PM +0200

13.02.2024 13:07 Bonita Montero kirjutas:
> function-object without any memory allocation. libstdc++ and libc++
> don't allocate any memory with such function<>-objects according
> to the standard, but MSVC does allocate external memory.
 
Cannot confirm that. MSVC++ 2022 x64 Release mode does not print "alloc"
at all for this program. In Debug mode there are a couple of allocs, but
these seem to be related to some std::string internals, not the
reference wrapper.
 
Bonita Montero <Bonita.Montero@gmail.com>: Feb 15 12:20PM +0100

Am 15.02.2024 um 14:34 schrieb Paavo Helde:
 
> at all for this program. In Debug mode there are a couple of allocs, but
> these seem to be related to some std::string internals, not the
> reference wrapper.
 
Sorry, I relied on the Debug build.
With Release build there are no allocations.
But I think the Debug build should also be up to the standard.
Paavo Helde <eesnimi@osa.pri.ee>: Feb 16 12:11AM +0200

15.02.2024 13:20 Bonita Montero kirjutas:
 
> Sorry, I relied on the Debug build.
> With Release build there are no allocations.
> But I think the Debug build should also be up to the standard.
 
Constructing and copying std::strings is allowed to allocate dynamic
memory. Make your string a bit longer and you will see allocations also
in Release builds.
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.

Wednesday, February 14, 2024

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 14 03:57PM +0100

Am 13.02.2024 um 19:08 schrieb Bonita Montero:
 
> There's nothing wrong with that. ...
Test this version which is the latest where I stopped further development:
 
#include <iostream>
#include <cstdlib>
#include <charconv>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <bit>
#include <fstream>
#include <string_view>
#include <thread>
#include <utility>
#include <new>
#include <span>
#include <array>
#include <cassert>
#include <sstream>
#if defined(_MSC_VER)
#include <intrin.h>
#elif defined(__GNUC__) || defined(__clang__)
#include <cpuid.h>

Tuesday, February 13, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 2 topics

wij <wyniijj5@gmail.com>: Feb 14 12:15AM +0800

On Sun, 2023-12-10 at 10:46 +0100, Bonita Montero wrote:
> cpuId( 0x80000006u );
> return ((unsigned)regs[2] >> 16) * 1024;
> }
 
I just wrote a class PrimeTab to test prime numbers. It took 73s to
complete.
0.1s is too unbelievable. Something must be wrong.
 
------------- PrimeTab.h
#include <Wy.stdlib.h>
#include <CSCall/VLInt.h> // Very Large Integer
 
// [Syn] PrimeTab is a table for prime numbers
//
class PrimeTab {
typedef uint64_t NumType;
WY_ENSURE(sizeof(NumType)<=sizeof(size_t));
Wy::VLInt m_ptab;
NumType m_maxn;
 
// [Syn] Get the bit position storing info. for n
// 0= pos for n (n is composite) is not available
//
size_t bpos(NumType n) {
switch(n%6) {
case 1: return 2*(n/6);
case 5: return 2*(n/6)+1;
default: return 0;
}
};
 
public:
WY_DECL_REPLY;
PrimeTab() : m_ptab(), m_maxn(0) {};
PrimeTab(const PrimeTab& s) : m_ptab(s.m_ptab), m_maxn(s.m_maxn)
{};
PrimeTab(PrimeTab& s, Wy::ByMove_t) : m_ptab(s.m_ptab,Wy::ByMove),
m_maxn(s.m_maxn) {};
 
// [Syn] Create prime table for numbers<=maxn
//
explicit PrimeTab(NumType maxn) : m_ptab(), m_maxn(maxn) {
for(NumType n=2; n<=m_maxn; ++n) {
size_t p= bpos(n);
if(p==0) {
continue; // composite number
}
if(m_ptab.bit(p)) {
continue; // composite number
}
for(NumType m=n+n; m<=m_maxn; m+=n) {
Wy::Errno r=m_ptab.set_bit(bpos(m),true);
if(r!=Wy::Ok) {
WY_THROW( Reply(r) );
}
}
};
};
NumType max_num() const { return m_maxn; };
bool is_prime(NumType n) {
if(n>m_maxn) {
WY_THROW( Reply(EINVAL) );
}
if(n<=6) {
switch(n) {
case 1: // FALLTHROUGH
case 2: // FALLTHROUGH
case 3: // FALLTHROUGH
case 5: return true;
default: return false;
}
}
size_t p= bpos(n);
if(p==0) {
return false;
}
return !m_ptab.bit(p);
};
void swap(PrimeTab& ano) {
m_ptab.swap(ano.m_ptab);
Wy::swap(m_maxn, ano.m_maxn);
};
void reset() {
m_ptab.reset();
};
Wy::Errno reset(NumType maxn) try {
PrimeTab tmp(maxn);
Wy::swap(tmp);
return Wy::Ok;
}
catch(const Wy::Errno& e) {
WY_RETURN(e);
};
Wy::Errno reset(const PrimeTab& rhs) {
WY_RETURN(m_ptab.reset(rhs.m_ptab));
};
PrimeTab& operator=(const PrimeTab& rhs) {
Wy::Errno r=m_ptab.reset(rhs.m_ptab);
if(r!=Wy::Ok) {
WY_THROW( Reply(r) );
}
return *this;
};
};
 
-------------- chk_primetab.cpp
#include <Wy.stdio.h>
#include "PrimeTab.h"
 
using namespace Wy;
 
void ck1() {
size_t cnt;
PrimeTab ptab(1LL<<32);
cnt=0;
for(size_t n=0; n<ptab.max_num(); ++n) {
if(ptab.is_prime(n)) {
++cnt;
// cout << n << WY_ENDL;
}
}
cout << "cnt=" << cnt << WY_ENDL;
};
 
int main()
try {
cout << "Check PrimeTab.h ..." WY_ENDL;
ck1();
cout << "OK" WY_ENDL;
return 0;
}
catch(const Errno& e) {
cerr << wrd(e) << WY_ENDL;
return -1;
}
catch(...) {
cerr << "main caught(...)" WY_ENDL;
return -1;
};
 
-------------
[]$ g++ chk_primetab.cpp -lwy -O2
[]$ time ./a.out
Check PrimeTab.h ...
cnt=203280222
OK
 
real 1m13.716s
user 1m13.180s
sys 0m0.168s
Bonita Montero <Bonita.Montero@gmail.com>: Feb 13 07:08PM +0100

Am 13.02.2024 um 17:15 schrieb wij:
 
> I just wrote a class PrimeTab to test prime numbers. It took 73s to
> complete.
> 0.1s is too unbelievable. Something must be wrong.
 
There's nothing wrong with that. I'm storing the bits as a bitmap and
I'm using a segmented sieve and I partition the part beyond the square
root in chunks which are according to the logical number of CPUs and
these are further divided into chunks which fit into the L2-cache.
And the sequential lookup inside the bitmap below the square root
is done with countl_zero, which maps to a single CPU-instruction
on most computers.
The naive single-threeaded approach without cache-partititioning is
for sure magnitudes slower.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 13 12:07PM +0100

If you initialize a function<>-object with a reference_wrapper it
is guaranteed that the function<>-object references an external
function-object without any memory allocation. libstdc++ and libc++
don't allocate any memory with such function<>-objects according
to the standard, but MSVC does allocate external memory.
 
#include <iostream>
#include <functional>
 
using namespace std;
 
void *operator new( size_t n )
{
cout << "alloc" << endl;
void *p = malloc( n );
if( !p )
throw bad_alloc();
return p;
}
 
void operator delete( void *p )
{
free( p );
}
 
int main()
{
function<void ()> fn;
string str( "hello word" );
auto lam = [str = str]() { cout << str << endl; };
fn = ref( lam );
fn();
}
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.

Sunday, February 11, 2024

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 10 08:53PM -0800

On 2/9/2024 9:11 PM, Bonita Montero wrote:
> header and re-enable them at the end, so that these headers
> won't disable those warnings for translation units of others
> using my code.
 
Yup. I think that would be the prudent thing to do. :^)
 
Okay.
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.

Saturday, February 10, 2024

Digest for comp.lang.c++@googlegroups.com - 1 update in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 10 06:11AM +0100

Am 09.02.2024 um 20:43 schrieb Chris M. Thomasson:
 
> I am saying that a user of your code might not want those
> warnings disabled at all. So, you should turn them back on.
 
In my own translation units I don't re-enable those warnings.
In headers I disable certain warnings at the beginning of the
header and re-enable them at the end, so that these headers
won't disable those warnings for translation units of others
using my code.
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.

Friday, February 9, 2024

Digest for comp.lang.c++@googlegroups.com - 2 updates in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 09 01:16PM +0100

Am 08.02.2024 um 22:28 schrieb Chris M. Thomasson:
 
> Keep in mind that your code disables those warnings. So, be sure to turn
> them back on for any and all user code!
 
Locking and unlocking mutexes is trivial and I don't need any addtional
aid for that. And MSVC runtime gives me a debug message if I try to
unlock a non-locked mutex; that's sufficient for me. And the shown
code is never trapped in that way.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 09 11:43AM -0800

On 2/9/2024 4:16 AM, Bonita Montero wrote:
> aid for that. And MSVC runtime gives me a debug message if I try to
> unlock a non-locked mutex; that's sufficient for me. And the shown
> code is never trapped in that way.
 
I am saying that a user of your code might not want those warnings
disabled at all. So, you should turn them back on.
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.

Thursday, February 8, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 1 topic

Bonita Montero <Bonita.Montero@gmail.com>: Feb 08 01:07PM +0100

Am 07.02.2024 um 21:38 schrieb Chris M. Thomasson:
> __________________________________
 
> You just have to be very careful with this type of logic. These warnings
> elude to that.
 
Can't you read my code ?
That's still sth. completely different than what I did.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 08 12:02PM -0800

On 2/8/2024 4:07 AM, Bonita Montero wrote:
 
>> You just have to be very careful with this type of logic. These
>> warnings elude to that.
 
> Can't you read my code ?
 
Yes.
 
 
> That's still sth. completely different than what I did.
 
I just wanted to get MSVC to pop out those "false" warnings. Mission
accomplished.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 08 01:28PM -0800

On 2/8/2024 4:07 AM, Bonita Montero wrote:
>> warnings elude to that.
 
> Can't you read my code ?
> That's still sth. completely different than what I did.
 
Keep in mind that your code disables those warnings. So, be sure to turn
them back on for any and all user code!
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.

Wednesday, February 7, 2024

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

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 07 12:47PM -0800

On 2/5/2024 11:10 PM, Chris M. Thomasson wrote:
> This is not giving me a warning, but an assertion. I am still wondering
> why Bonita has to suppress all of those warnings wrt this thread ala MSVC:
 
> https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k
[...]
 
Okay, made some progress. Here is a little example of where the warnings
pop up. "Sketchy" use of std::unique_lock, well, imvvho that is:
___________________________________________
#include <iostream>
#include <functional>
#include <thread>
#include <mutex>
#include <cassert>
 
 
namespace ct
{
struct mutex_test
{
std::mutex m_mutex;
 
void
bar(std::unique_lock<std::mutex>& lock)
{
assert(lock);
lock.unlock();
}
 
void
foo()
{
std::unique_lock<std::mutex> lock(m_mutex);
 
// lock will be unlocked after this call!
bar(lock);
 
lock.lock(); // Yup...
}
};
}
 
 
int
main()
{
std::cout << "ct_threads... ;^)\n" << std::endl;
 
{
ct::mutex_test test;
 
test.foo();
}
 
return 0;
}
___________________________________________
 
 
Interesting wrt MSVC.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 07 05:13PM +0100

Am 06.02.2024 um 20:55 schrieb Chris M. Thomasson:
 
>> Where the compiler warns me there are no errors,
>> these are false warnings.
 
> Well, that deserves a bug report?
 
I won't file it.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 07 05:15PM +0100

Am 06.02.2024 um 21:07 schrieb Chris M. Thomasson:
>     lock.unlock();
>     //lock.unlock(); // this throws an exception.
> }
 
That's sth. totally different. My function has the pre-condition
that it inherits the lock of the calling function and sometimes
it unlocks it.
 
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 07 12:38PM -0800

On 2/7/2024 8:15 AM, Bonita Montero wrote:
 
> That's sth. totally different. My function has the pre-condition
> that it inherits the lock of the calling function and sometimes
> it unlocks it.
 
Ahhh. I got them with:
__________________________________
namespace ct
{
struct mutex_test
{
std::mutex m_mutex;
 
void
bar(std::unique_lock<std::mutex>& lock)
{
assert(lock); // better be locked!
lock.unlock();
}
 
void
foo()
{
std::unique_lock<std::mutex> lock(m_mutex);
bar(lock); // beware. unlocks the damn thing!
lock.lock(); // okay...
}
};
}
__________________________________
 
Give the warnings:
__________________________________
Severity Code Description Project File Line Suppression State Details
Warning C26115 Failing to release lock 'this->m_mutex' in function
'ct::mutex_test::foo'. ct_threads
D:\ct_dev\projects\ct_threads\ct_threads\ct_main.cpp 26
 
Warning C26111 Caller failing to release lock 'this->m_mutex' before
calling function 'std::unique_lock<std::mutex>::lock'. ct_threads
D:\ct_dev\projects\ct_threads\ct_threads\ct_main.cpp 26

Warning C26110 Caller failing to hold lock 'lock' before calling
function 'std::unique_lock<std::mutex>::unlock'. ct_threads
D:\ct_dev\projects\ct_threads\ct_threads\ct_main.cpp 18
__________________________________
 
 
You just have to be very careful with this type of logic. These warnings
elude to that.

 
 
[...]
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 07 12:41PM -0800

On 2/7/2024 8:13 AM, Bonita Montero wrote:
>>> these are false warnings.
 
>> Well, that deserves a bug report?
 
> I won't file it.
 
Maybe you should. However, the warnings do flag some "sketchy" things
are going on.
"ₛcₕₘₑᵣzfᵣₑᵢₑ ₛₜₑᵣbₑₕᵢₗfₑ" <w502fs8g@duck.com>: Feb 07 02:26AM

Anfragen: Sterbehilfe.yen631{@}dralias.[com] wie kann ich als deutscher
natrium pentobarbital kaufen schweiz.
 
Wenn Sie Pentobarbital (Nembutal) benötigen, aber einen diskreten Kauf
tätigen möchten, dann sind Sie bei uns genau richtig! Unsere
spezialisierten Dienstleistungen sind bestrebt, eine bequeme und
unkomplizierte Möglichkeit zur Bestellung von Pentobarbital-Nembutal in
pharmazeutischer Qualität zu bieten. Für sicheren Chat verwenden Sie die
Threema-ID: MX8ESP4F.
 
Unser Status als Top-Anbieter von Sterbehilfe medikamenten in Europa macht
uns stolz, da wir auf hochwertiges Apotheken-Pentobarbital angewiesen sind.
Dieser Erfolg spiegelt unser Engagement und unsere Kompetenz wider, unseren
geschätzten Kunden erstklassige Produkte zu liefern.
 
Es liegt uns am Herzen, Sie bei der Beschaffung von Pentobarbital in seinen
verschiedenen Formen, einschließlich Flüssigkeit, Pulver oder
Injektionsform, zu unterstützen. Bei der Suche nach vertrauenswürdigen
Lieferanten von Sterbehilfemedikamenten, die ihren Anforderungen gerecht
werden, stehen Käufer häufig vor Herausforderungen. Ihre Enttäuschung ist
oft darauf zurückzuführen, dass sie gefälschte Produkte erhalten.
 
Wenn Sie uns als Ihren Pentobarbital-Lieferanten auswählen, können Sie
sicher sein, dass wir höchste Qualität in pharmazeutischer Qualität
erhalten und garantieren, dass unsere Medikamente den höchsten Standards
entsprechen. Darüber hinaus sorgt unser Bemühen um einen sicheren Transport
dafür, dass Ihre Bestellung sicher an Sie geliefert wird. Wir sind uns der
Bedeutung von Diskretion bewusst und ergreifen Maßnahmen, um unseren
geschätzten Kunden ein schnelles und reibungsloses Einkaufserlebnis zu
bieten.
 
Wo kann man diskret eine tödliche Menge Pentobarbital für einen
schmerzfreien Tod erwerben? Anfragen: Sterbehilfe.yen631{@}dralias.[com]
oder Für sicheren Chat verwenden Sie die Threema-ID: MX8ESP4F
 
Bei verschiedenen Anwendungen werden Barbiturate allgemein als
Beruhigungsmittel für das Zentralnervensystem anerkannt. Sie werden häufig
als Beruhigungsmittel, Hypnotika, Antikonvulsiva in subhypnotischen Mengen
und sogar zur Sterbehilfe eingesetzt und bieten bedürftigen Menschen einen
ruhigen Abschluss.
 
Bitte Vorsicht walten lassen:
Sie bestätigen, dass Sie mindestens 27 Jahre alt sind. Durch Ihre
Einwilligung sind Sie sich voll und ganz darüber im Klaren, dass die auf
dieser Website zum Kauf angebotenen Artikel erhebliche Gefahren darstellen.
Sie verstehen die Bedeutung dieser Anerkennung und erklären sich damit
einverstanden, dass es in Ihrer Verantwortung liegt, diese Produkte
aufgrund ihrer gefährlichen Eigenschaften mit größter Sorgfalt und Respekt
zu behandeln.
 
Anfragen: Sterbehilfe.yen631{@}dralias.[com] wie kann ich als deutscher
natrium pentobarbital kaufen schweiz.
 
 
--
ᴷᵒⁿᵗᵃᵏᵗ: ˢᵗᵉʳᵇᵉʰⁱˡᶠᵉ.ʸᵉⁿ⁶³¹{@}ᵈʳᵃˡⁱᵃˢ.[ᶜᵒᵐ]
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.

Tuesday, February 6, 2024

Digest for comp.lang.c++@googlegroups.com - 12 updates in 2 topics

Bonita Montero <Bonita.Montero@gmail.com>: Feb 06 07:12AM +0100

Am 05.02.2024 um 20:09 schrieb Chris M. Thomasson:
 
> Can you create a little self-contained example that shows these warnings?
 
Make the pragmas commented and look what the IDE shows as warnings.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 10:34PM -0800

On 2/5/2024 10:12 PM, Bonita Montero wrote:
> Am 05.02.2024 um 20:09 schrieb Chris M. Thomasson:
 
>> Can you create a little self-contained example that shows these warnings?
 
> Make the pragmas commented and look what the IDE shows as warnings.
 
What is in:
______________________
#include <cassert>
#include "thread_pool.h"
#include "invoke_on_destruct.h"
______________________
 
?
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 10:36PM -0800

On 2/5/2024 10:34 PM, Chris M. Thomasson wrote:
> #include "invoke_on_destruct.h"
> ______________________
 
> ?
 
You have some issues here. These warnings are not for kicks and giggles,
so to speak. If these warnings are wrong, you need to file a bug report
to the MSVC team.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 10:38PM -0800

On 2/5/2024 10:12 PM, Bonita Montero wrote:
> Am 05.02.2024 um 20:09 schrieb Chris M. Thomasson:
 
>> Can you create a little self-contained example that shows these warnings?
 
> Make the pragmas commented and look what the IDE shows as warnings.
 
Think about getting a warning free compile. Think about what these
warnings actually mean. If you find a bug, report it to the MSVC team.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 10:46PM -0800

On 2/5/2024 10:34 PM, Chris M. Thomasson wrote:
> #include <cassert>
> #include "thread_pool.h"
 
 
> #include "invoke_on_destruct.h"
^^^^^^^^^^^^^^^^^^^^^^
 
What is that for?
 
Bonita Montero <Bonita.Montero@gmail.com>: Feb 06 11:15AM +0100

Am 06.02.2024 um 07:34 schrieb Chris M. Thomasson:
> ______________________
> #include <cassert>
> #include "thread_pool.h"
 
The header I posted.
 
> #include "invoke_on_destruct.h"
 
Sth. like experimental::scope_exit, this is my code:
 
#pragma once
#include <utility>
 
template<typename Fn>
requires requires( Fn fn ) { { fn() }; }
struct invoke_on_destruct
{
private:
Fn m_fn;
bool m_enabled;
public:
invoke_on_destruct( Fn &&fn ) :
m_fn( std::forward<Fn>( fn ) ),
m_enabled( true )
{
}
~invoke_on_destruct()
{
if( m_enabled )
m_fn();
}
void operator ()()
{
if( m_enabled )
m_enabled = false,
m_fn();
}
void disable()
{
m_enabled = false;
}
invoke_on_destruct &enable()
{
m_enabled = true;
return *this;
}
};
Bonita Montero <Bonita.Montero@gmail.com>: Feb 06 11:17AM +0100

Am 06.02.2024 um 07:38 schrieb Chris M. Thomasson:
 
> Think about getting a warning free compile. Think about what these
> warnings actually mean. If you find a bug, report it to the MSVC team.
 
Where the compiler warns me there are no errors,
these are false warnings.
Bonita Montero <Bonita.Montero@gmail.com>: Feb 06 02:01PM +0100

Am 06.02.2024 um 07:38 schrieb Chris M. Thomasson:
 
>> Make the pragmas commented and look what the IDE shows as warnings.
 
> Think about getting a warning free compile. Think about what these
> warnings actually mean. If you find a bug, report it to the MSVC team.
 
Try this ...
 
void fn( unique_lock<mutex> &lock )
{
assert(lock);
lock.unlock();
}
 
... and you'll get a warning.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 06 11:55AM -0800

On 2/6/2024 2:17 AM, Bonita Montero wrote:
>> warnings actually mean. If you find a bug, report it to the MSVC team.
 
> Where the compiler warns me there are no errors,
> these are false warnings.
 
Well, that deserves a bug report?
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 06 12:07PM -0800

On 2/6/2024 5:01 AM, Bonita Montero wrote:
>     lock.unlock();
> }
 
> ... and you'll get a warning.
 
Fwiw, I get no warning with:
 
{
std::unique_lock<std::mutex> lock(m_mutex);
assert(lock);
lock.unlock();
//lock.unlock(); // this throws an exception.
}
 
The interesting part is the code for std::unique_lock:
 
~unique_lock() noexcept {
if (_Owns) {
_Pmtx->unlock();
}
}
 
 
I was wondering why std::unique_lock did not try to unlock it twice in
the dtor. Well, the code for std::~unique_lock that MSVC is using
answers my question. Its that _Owns variable. Humm...
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 11:10PM -0800

This is not giving me a warning, but an assertion. I am still wondering
why Bonita has to suppress all of those warnings wrt this thread ala MSVC:
 
https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k
 
Here is some bugged code I just created, wrt MSVC version 17.8.5. No
warnings, but an assertion:
 
https://i.ibb.co/QQFyZQq/image.png
 
code:
____________________________________
#include <iostream>
#include <functional>
#include <thread>
#include <mutex>
 
 
namespace ct
{
struct mutex_test
{
std::mutex m_mutex;
 
void
works()
{
m_mutex.lock();
m_mutex.unlock();
}
 
 
void
foobar()
{
m_mutex.lock();
//m_mutex.unlock(); YIKES!
}
};
}
 
 
int
main()
{
std::cout << "ct_threads... ;^)\n" << std::endl;
 
{
ct::mutex_test test;
 
test.works();
test.foobar(); // humm... Kabboom!
}
 
return 0;
}
____________________________________
 
 
Btw, I am going to port my new XCHG based code from Relacy race detector
into actual C++ code where we all can play with it. Getting to a point
where I need to use it for a project.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 06 12:33AM -0800

On 2/5/2024 11:10 PM, Chris M. Thomasson wrote:
> This is not giving me a warning, but an assertion. I am still wondering
> why Bonita has to suppress all of those warnings wrt this thread ala MSVC:
 
> https://groups.google.com/g/comp.lang.c++/c/pFsb3JI11-k
[...]
 
Sometime tomorrow I can work on this. I need to compile the bugged test
code with the warning level bumped up.
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.

Monday, February 5, 2024

Digest for comp.lang.c++@googlegroups.com - 3 updates in 1 topic

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 04 08:20PM -0800

On 2/3/2024 10:41 PM, Bonita Montero wrote:
 
>> What happens if you turn off all of those very important warnings?
 
> What a question ...
> I get incorrect warnings while compiling.
 
https://youtu.be/hAMQIvEtcJM
Bonita Montero <Bonita.Montero@gmail.com>: Feb 05 09:01AM +0100

Am 04.02.2024 um 22:59 schrieb Chris M. Thomasson:
 
> Why are they incorrect, according to you? ...
 
No, according to what they should warn for.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Feb 05 11:09AM -0800

On 2/5/2024 12:01 AM, Bonita Montero wrote:
> Am 04.02.2024 um 22:59 schrieb Chris M. Thomasson:
 
>> Why are they incorrect, according to you? ...
 
> No, according to what they should warn for.
 
Can you create a little self-contained example that shows these warnings?
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.