I know a port exists, but for all I know it's an add-on to an already existing djgpp install, so no <thread> header becomes available after installing it. But if pth could be built during build-time of djgpp, <thread> would become available. Does anybuild script (for linux) feature this? I tried to do the hack myself, but it took too much time. Maybe there's an alternative to GNU pth to get <thread>?
Perhaps my insight will help you:
1. I have found gnu pth supported the largest subset of pthreads of all alternatives, but it requires wattcp in order to build,
2. zlib is a dependency of wattcp, so it needs to be built first,
3. both zlib and wattcp require hacks to build,
4. gnu pth itself requires hacks to build, alas too many for me.
I stopped at 4th step.
I don't recall zlib being needed to build wattcp and I don't recall it
being a hack to build for DJGPP either. Did you read the docs?
I don't really care anymore, I only built it, because it is a gnu pth dependency and if you build wattcp, you might zlib just as well. But building gnu pth failed for sure. This was done using xgcc, during gcc build-time. Maybe one of you manages toI don't really recall why I needed zlib, though, it was a long time ago. I am only guessing wattcp.Zlib is a configurable wattcp option: see USE_GZIP_COMPR in config.h
I don't really recall why I needed zlib, though, it was a long time ago. I
am only guessing wattcp.
I don't really care anymore, I only built it, because it is a gnu pth dependency and if you build wattcp, you might zlib just as well. But building gnu pth failed for sure. This was done using xgcc, during gcc build-time. Maybe one of you manages tobuild gnu pth as well and then there will be a <thread> header available and pthreads.
Sorry you are getting frustrated. I've never had to use pthreads underI'm just the maintainer of the "dosbox-gcc" PKGBUILD and was sharing thoughts with the rest of you. There is a lot of room for improvement: OpenGL (mesa3d), <thread>, sockets, ...
DOS so I really have no idea if anyone has done it successfully and if there's a precompiled port of it ready to go for your project.
On Monday, May 2, 2022 at 4:55:00 PM UTC+2, Frank Sapone (emoaddict15@gmail.com) [via djgpp@delorie.com] wrote:
Sorry you are getting frustrated. I've never had to use pthreads underI'm just the maintainer of the "dosbox-gcc" PKGBUILD and was sharing thoughts with the rest of you. There is a lot of room for improvement: OpenGL (mesa3d), <thread>, sockets, ...
DOS so I really have no idea if anyone has done it successfully and if
there's a precompiled port of it ready to go for your project.
On 5/2/2022 11:17 PM, janezz55 (jane...@gmail.com) [viaIt's a cross-compiler, so it runs under arch linux. The default "djgpp-gcc" PKGBUILD targets the i686 IA, which is NOT supported by dosbox.
dj...@delorie.com] wrote:
I found the Arch Linux site for this but I am confused by the
description "djgpp cross-compiler for the dosbox environment". What does
this mean? I thought DJGPP could run in dosbox as-is or am I mistaken?
I know a port exists, but for all I know it's an add-on to an already existing djgpp install, so no <thread> header becomes available after installing it. But if pth could be built during build-time of djgpp, <thread> would become available. Does anybuild script (for linux) feature this? I tried to do the hack myself, but it took too much time. Maybe there's an alternative to GNU pth to get <thread>?
Surprisingly, configuring gcc with --enable-threads is actually possible, but it did require a small patch to Pth. The executables it produces however, will
not run. A thread-aware libgcc will try to lock a mutex in __register_frame_info(), which is invoked from crt0 before __crt1_startup(). But locking a mutex involves a whole series of libc functions that rely on things like _dos_ds, which are only initialized from __crt1_startup().
Surprisingly, configuring gcc with --enable-threads is actually possible, but
it did require a small patch to Pth. The executables it produces however, will
not run. A thread-aware libgcc will try to lock a mutex in
__register_frame_info(), which is invoked from crt0 before __crt1_startup(). >> But locking a mutex involves a whole series of libc functions that rely on >> things like _dos_ds, which are only initialized from __crt1_startup().
patch libgcc? Why would it want to lock a mutex anyway?
whenever an exception is thrown. So it makes sense to use a mutex here, but in our case it's just not necessary to do so on startup.
whenever an exception is thrown. So it makes sense to use a mutex here, but >> in our case it's just not necessary to do so on startup.
Yeah, I have a feeling you're already working on a patch :) So, we will have std::thread under dos, amazing.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (0 / 16) |
Uptime: | 29:30:02 |
Calls: | 5,571 |
Calls today: | 1 |
Files: | 11,684 |
Messages: | 5,128,298 |