It seems to me that the whole discussion has gone off-topic. No one here is going to write their own OS, I supose.
Now it is clear to me that people that uses C++11 has gone for the std::thread, and for the rest, the majority is using pthreads and winapi directly, or wrapped somehow.
Discussing about who's programmed a thread at the lowest level is a nonsense today, at least it wasn't my intention when I created the thread. I wanted to know opinions about the library (TinyThread++) from a practical point of view taking into account that is intended to be used inside a chess engine.
Regards.
TinyThread++
Moderators: hgm, Rebel, chrisw
-
- Posts: 214
- Joined: Thu Sep 01, 2011 5:38 pm
- Location: Seville, Spain
Re: TinyThread++
Still learning how to play chess...
knigths move in "L" shape ¿right?
knigths move in "L" shape ¿right?
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: TinyThread++
If you use pthreads, you're depending on third party libraries.mar wrote:However you seem to be misinterpreting what I call DIY.
The point is that what you wrote is not what you really do:
And this is also not what you do:mar wrote:Well I'll give you a simple question, do you prefer to depend on 16kb or 90mb of third-party code? I would personally choose neither and would write my own of course.
You're not wrapping OS functionality. You are wrapping pthreads. (C++11 libs most likely are not wrapping pthreads but using syscalls, but I have not checked this... there's no reason to look under the hood.)mar wrote:do it yourself (=wrap OS functionality, that's what C++11 libs/boost do anyway, except maybe for some clever hacks).
OK, one could argue pthreads is part of the OS. But then gcc, g++, stdlibc++ are part of the OS just as much.
There's nothing wrong with wrapping pthreads, obviously. I see nothing wrong with using C++11 threads either, where available.
Rein Halbersma wrote:Full control is an illusion at worst, and a very expensive dream at best. You might as well grow your own vegetables, knit your own clothes and build your own house to rule out any chance of insecticides, child labor and asbestos roofs etc
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: TinyThread++
I think considering POSIX implementation third party libraries is rather extreme, but this is word play anyway.syzygy wrote:If you use pthreads, you're depending on third party libraries.
See for yourself: https://github.com/mirrors/gcc/blob/mas ... hr-posix.hYou're not wrapping OS functionality. You are wrapping pthreads. (C++11 libs most likely are not wrapping pthreads but using syscalls, but I have not checked this... there's no reason to look under the hood.)
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: TinyThread++
But considering libstdc++ to be a third party library is not extreme?mar wrote:I think considering POSIX implementation third party libraries is rather extreme, but this is word play anyway.syzygy wrote:If you use pthreads, you're depending on third party libraries.
Imho, the position you were advocating is extreme.
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: TinyThread++
But I'm not considering lidstdc++ third party...syzygy wrote:But considering libstdc++ to be a third party library is not extreme?
Imho, the position you were advocating is extreme.
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: TinyThread++
Well, it seemed you were clearly distinguishing between on the one hand C++11 and on the other hand "do it yourself = wrap OS functionality" (which apparently does not exclude using off-the-shelf pthreads).mar wrote:But I'm not considering lidstdc++ third party...syzygy wrote:But considering libstdc++ to be a third party library is not extreme?
Imho, the position you were advocating is extreme.
So I guess we can now say that using C++11 threads is an example of directly using OS functionality.