Language:
switch to room list switch to menu My folders
Go to page: First ... 90 91 92 93 [94]
[#] Mon May 13 2024 22:27:29 EDT from IGnatius T Foobar

[Reply] [ReplyQuoted] [Headers] [Print]

Dunno whether this ought to be in the *ix room or in the programming room, but whatever...

Today I came to the realization that ever since NPTL was merged into glibc some ~20 years ago, it's no longer necessary to specify "-lpthread" when compiling a multithreaded program. I tried it and it worked fine. I looked at the library on disk and, sure enough, it's just a null library that is only there to keep build scripts from breaking.

I was about to remove "-lpthread" from my published Makefiles but then I stopped to consider, it might still be required on non-Linux systems. FreeBSD in particular looks like it has several different implementations of POSIX Threads to choose from (why?) and you have to specify "-lpthread" to make it link that one, or you can specify one of several others.

Am I correct about that? If you try to use POSIX Threads library calls on BSD and don't link a threading library, will it fail to link?

[#] Sat May 18 2024 14:31:52 EDT from darknetuser

[Reply] [ReplyQuoted] [Headers] [Print]

Am I correct about that? If you try to use POSIX Threads library
calls on BSD and don't link a threading library, will it fail to link?




I think it will fail, but then I have not experimented with that in a while. I still have not so old memories of forgetting to add -lpthread and have the build failin my face.

Go to page: First ... 90 91 92 93 [94]