opendlang / opend

Boost Software License 1.0
84 stars 18 forks source link

Thread OS API #55

Closed IgorDeepakM closed 5 months ago

IgorDeepakM commented 7 months ago

This is the juggernaut. Trying to unshuffle osthread.d is like doing surgery on an oyster and there is probably more to it in the future.

The risk breakage is high because I haven't tested this on the BSD platforms or Solaris. On Mac I have no possibility to test so it will certainly not work.

I'm doing to PR right now in order to see what the CI tests says.

There is a lot of potential of improvements, for example avoiding unnecessary reallocs that is made of every thread. Hopefully with making this more modular it will be more clear how this can be improved.

denizzzka commented 6 months ago

This is the juggernaut. Trying to unshuffle osthread.d is like doing surgery on an oyster and there is probably more to it in the future.

Absolutely agree!

Maybe diff between current ~master and this code also may help you: https://github.com/denizzzka/druntime/blob/non_posix/src/core/thread/osthread.d

This is my dirty (but working) attempt to implement interface for external backends. Diff will highlight places where is needed to pay attention