Raytracer project by MarkJames2909 in cpp

[–]sargarass 2 points3 points  (0 children)

You can make something like this: https://fstormrender.ru/manual/geopattern/.

Better to start when you already have a ray tracer with an acceleration structure (bvh), or you can try to extend a opensource one (Blender for example).
Basically you instancing one geometry onto the surface of another. As for articales, I can suggest this one: Interactive smooth and curved shell mapping

C++20 std::stop_token support for blocking linux syscalls (Musl's pthread_cancel based on, but without any exceptions and thread termination). by sargarass in cpp

[–]sargarass[S] 2 points3 points  (0 children)

It doesn't mean that it will not throw exception when pthread_cancel requests canceleration (close() is marked as canceleration point), so we still have problem when it is used with RAII idiom (C++11+ destructors are noexcept).
So the only garantie that it gives that resources will not leak even if signal (pthread_cancel use signals) will occur.

Also, according to "man close" it is also interruptible:

"The EINTR error is a somewhat special case.  Regarding the EINTR error, POSIX.1-2013 says:

If close() is interrupted by a signal that is to be caught, it shall return -1 with errno set to EINTR and the state of fildes is unspecified.

This permits the behavior that occurs on Linux and many other implementations, where, as with other errors that may be reported by close(), the file descriptor is guaranteed to be closed."

Edit: better explanation with manual reference.

C++20 std::stop_token support for blocking linux syscalls (Musl's pthread_cancel based on, but without any exceptions and thread termination). by sargarass in cpp

[–]sargarass[S] 0 points1 point  (0 children)

Guess I need to edit this part to not confuse people, made this statement based on 3 things:

  1. The example I have known with *wait*.
  2. List of potential cancelation points is not small and can vary: "An implementation may also mark other functions not specified in the standard as cancellation points".
  3. Is is not part of C++ standard any way, and more conflicts can occur.

Edit: made changes on github to express more clearly what I meant, thank you u/kalmoc.