Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
993 views
in Technique[技术] by (71.8m points)

ubuntu - Boost.Thread Linking - boost_thread vs. boost_thread-mt

It's not clear to me what linking options exist for the Boost.Thread 1.34.1 library. I'm on Ubuntu 8.04 and I've found that when using either boost_thread or boost_thread-mt during linking both compile and run, but I don't see any documentation on these or any other linking options in above link.

What Boost.Thread linking options are available and what do they mean?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Well...

The first amusing thing is that the -mt modifier in the name is to indicate the library is Ok for multithreading. Which could lead us to believe that boost_thread (without this modifier) could be multithread-unsafe...

But the real thing is that (as seen on my own Ubuntu 10.04 box), boost_thread is a soft link to boost_thread-mt, which means the two are one and the same.

If you want to verify it, you can open a console on your ubuntu (make the console fullscreen because the names are long), then type:

cd /usr/lib

to move to the directory where the Boost libraries are. And then:

ls -l ./libboost_thread*

Which will list all the files starting with libboost_thread, with additionnal information. The result will be something like:

[...] ./libboost_thread.a
[...] ./libboost_thread-mt.a -> libboost_thread.a

As you can see, libboost_thread.a is a static library, and libboost_thread-mt.a is a soft link to libboost_thread.a


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...