In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Write a multithreaded program first.
Makefile
Add the-g parameter to generate adjustable information, which can be debugged.
Pthread is not the default library under Linux, that is, when linking, the entry address of the elder function in the phread library cannot be found, so the link will fail. When gcc compiles, the attachment can be solved by adding the-lpthread parameter.
Gdb test enters debugging
Make a breakpoint where you need to debug, and run runs to the breakpoint.
R runs to the breakpoint, and info thread can view the thread being debugged.
Thread apply all bt lets all threads print stack information
Set scheduler-locking off | on | step
When using the step or continue command to debug the currently debugged thread, other threads are also executing at the same time. If we only want the debugged thread to execute and other threads stop waiting, then lock the thread to be debugged and let it run.
Off: no thread is locked, all threads execute.
On: only the currently debugged thread is executed.
Step: prevents other threads from preempting the current thread when it steps into debugging. Other threads are rerunned only when next, continue, util, and finish are used.
Show scheduler-locking:
The purpose of this command is to see the mode of the current locked thread.
Thank you for reading, hope to help you, thank you for your support to this site!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.