blt_8u6bgf6@1fcy52bz_kvxxu.net writes:
> On Sun, 31 Mar 2019 08:51:29 -0400
> Sam <
s...@email-scan.com> wrote:
>
> >
blt_...@rjrnwk17q3gki8i5ps4p50dlbz.org writes:
> >
> >> On Sun, 31 Mar 2019 09:27:34 GMT
> >> Melzzzzz <
Melz...@zzzzz.com> wrote:
> >> >
> >> >Use pthread_rwlock_t, as you don't have c++17 compliant compiler.
> >>
> >> Umm, because I was hoping to use C++ threading as its syntatically tidier
> >> than pthreads and getting lambdas to work with pthreads would probably be
> a
> >> PITA (I don't know, never tried).
> >
> >"Getting lambdas to work with pthreads", whatever that means, is no harder
>
> I'll assume English is your second language if you didn't understand that.
You seem to be assuming a great deal many of things.
That, understandably, is often the only possible avenue when no other
options are available.
The statement "Getting lambdas to work with threads" is logically equivalent
to "making elephants fly with automobiles".
There's nothing unique about POSIX threads that requires employing any
unique aspects or attributes of lambdas. Or vice versa. Most fundamental
POSIX structures are not copyable; but that's not some earth-shattering
property either. Plenty of classes in the C++ library are also not copyable.
Like std::ifstream, for example. So the same issues, with regards to
captures, apply to POSIX threads as they do to std::ifstream, when it comes
to lambdas. There's nothing particularly special about POSIX threads and
lambdas.
So, your obsession with lambdas and POSIX threads is, pretty much, totally
unwarranted.
> >It shouldn't take more than an hour, or so, to write a C++ class wrapper
> >around pthread_rwlock_t that implements similar functionality to the C++17
> >class. It's not complicated. If you started when you posted your first
> >message in this thread, you would've probably been done by the time you
> >posted your second message in this thread.
>
> I could write a class wrapper around pthreads? Wow! Why didn't I think of
> that??
That's why I'm here, to help.
> Truly a savant and nobel prizes surely await you!
I'll decline. I don't like traveling.
> I guess trying to be a smart ass is more satisfying for you than just giving
> a
> simple answer, right?
I just did give a simple answer: write a simple wrapper. Can't get any
simpler than that.