IO 模型知多少 | 代码篇 (3)

有上可知,进程Id为3763,依次执行以下命令可以查看该进程的线程和产生的文件描述符:

shengjie@ubuntu:~/coding/dotnet/Io.Demo$ cd /proc/3763 # 进入进程目录 shengjie@ubuntu:/proc/3763$ ls attr cmdline environ io mem ns pagemap sched smaps_rollup syscall wchan autogroup comm exe limits mountinfo numa_maps patch_state schedstat stack task auxv coredump_filter fd loginuid mounts oom_adj personality sessionid stat timers cgroup cpuset fdinfo map_files mountstats oom_score projid_map setgroups statm timerslack_ns clear_refs cwd gid_map maps net oom_score_adj root smaps status uid_map shengjie@ubuntu:/proc/3763$ ll task # 查看当前进程启动的线程 total 0 dr-xr-xr-x 9 shengjie shengjie 0 5月 10 16:36 ./ dr-xr-xr-x 9 shengjie shengjie 0 5月 10 16:34 ../ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3763/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3765/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3766/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3767/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3768/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3769/ dr-xr-xr-x 7 shengjie shengjie 0 5月 10 16:36 3770/ shengjie@ubuntu:/proc/3763$ ll fd 查看当前进程系统调用产生的文件描述符 total 0 dr-x------ 2 shengjie shengjie 0 5月 10 16:36 ./ dr-xr-xr-x 9 shengjie shengjie 0 5月 10 16:34 ../ lrwx------ 1 shengjie shengjie 64 5月 10 16:37 0 -> /dev/pts/1 lrwx------ 1 shengjie shengjie 64 5月 10 16:37 1 -> /dev/pts/1 lrwx------ 1 shengjie shengjie 64 5月 10 16:37 10 -> 'socket:[44292]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 100 -> /dev/random lrwx------ 1 shengjie shengjie 64 5月 10 16:37 11 -> 'socket:[41675]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 13 -> 'pipe:[45206]' l-wx------ 1 shengjie shengjie 64 5月 10 16:37 14 -> 'pipe:[45206]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 15 -> /home/shengjie/coding/dotnet/Io.Demo/bin/Debug/netcoreapp3.0/Io.Demo.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 16 -> /home/shengjie/coding/dotnet/Io.Demo/bin/Debug/netcoreapp3.0/Io.Demo.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 17 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Runtime.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 18 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Console.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 19 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Threading.dll lrwx------ 1 shengjie shengjie 64 5月 10 16:37 2 -> /dev/pts/1 lr-x------ 1 shengjie shengjie 64 5月 10 16:37 20 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Runtime.Extensions.dll lrwx------ 1 shengjie shengjie 64 5月 10 16:37 21 -> /dev/pts/1 lr-x------ 1 shengjie shengjie 64 5月 10 16:37 22 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Text.Encoding.Extensions.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 23 -> /dev/urandom lr-x------ 1 shengjie shengjie 64 5月 10 16:37 24 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Net.Sockets.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 25 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Net.Primitives.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 26 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/Microsoft.Win32.Primitives.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 27 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Diagnostics.Tracing.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 28 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Threading.Tasks.dll lrwx------ 1 shengjie shengjie 64 5月 10 16:37 29 -> 'socket:[43429]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 3 -> 'pipe:[42148]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 30 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Threading.ThreadPool.dll lrwx------ 1 shengjie shengjie 64 5月 10 16:37 31 -> 'socket:[42149]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 32 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Memory.dll l-wx------ 1 shengjie shengjie 64 5月 10 16:37 4 -> 'pipe:[42148]' lr-x------ 1 shengjie shengjie 64 5月 10 16:37 42 -> /dev/urandom lrwx------ 1 shengjie shengjie 64 5月 10 16:37 5 -> /dev/pts/1 lrwx------ 1 shengjie shengjie 64 5月 10 16:37 6 -> /dev/pts/1 lrwx------ 1 shengjie shengjie 64 5月 10 16:37 7 -> /dev/pts/1 lr-x------ 1 shengjie shengjie 64 5月 10 16:37 9 -> /usr/share/dotnet/shared/Microsoft.NETCore.App/3.0.0/System.Private.CoreLib.dll lr-x------ 1 shengjie shengjie 64 5月 10 16:37 99 -> /dev/urandom

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpfjwg.html