Is Moab Multithreaded?


[root@vbox-head-centos6 ~]# showconfig -v|grep THREAD
THREADPOOLSIZE                  8

I commonly use ps to see how many threads (or linux lightweight processes) 
are in use, e.g.

ps -elmT

F S   UID   PID  SPID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
...
1 -     0  8222     -     1  2   -   - - 231521 -     ?        06:23:22 moab
1 S     0     -  8222     -  0  80   0 -     - poll_s -        01:14:49 -
1 S     0     -  8223     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8224     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8225     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8226     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8227     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8228     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8229     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8230     -  0  80   0 -     - futex_ -        00:00:07 -
1 S     0     -  8231     -  0  80   0 -     - futex_ -        00:00:37 -
1 S     0     -  8232     -  0  80   0 -     - poll_s -        01:37:43 -
1 S     0     -  8233     -  1  80   0 -     - poll_s -        03:29:11 -
...

You can also gdb the moab process and look at the thread list:

[root@vbox-head-centos6 ~]# gdb ´which moab´ ´pgrep moab´
(gdb) info thread
  12 Thread 0x2aaaad5e4700 (LWP 8223)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  11 Thread 0x2aaaad7e5700 (LWP 8224)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  10 Thread 0x2aaaad9e6700 (LWP 8225)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  9 Thread 0x2aaaadbe7700 (LWP 8226)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  8 Thread 0x2aaaadde8700 (LWP 8227)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  7 Thread 0x2aaaadfe9700 (LWP 8228)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  6 Thread 0x2aaaae1ea700 (LWP 8229)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  5 Thread 0x2aaaae3eb700 (LWP 8230)  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  4 Thread 0x2aaaae5ec700 (LWP 8231)  0x00002aaaaacd9a5e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  3 Thread 0x2aaaae7ed700 (LWP 8232)  0x00002aaaabbc7623 in select ()
   from /lib64/libc.so.6
  2 Thread 0x2aaaae9ee700 (LWP 8233)  0x00002aaaabbc7623 in select ()
   from /lib64/libc.so.6
* 1 Thread 0x2aaaac0921a0 (LWP 8222)  0x00002aaaabbc7623 in select ()
   from /lib64/libc.so.6
(gdb) 

You can get a backtrace of each of them by running the command: thread apply all bt

When I do this, I can see there are 8 request handlers, a LazyWriteWatchDog, a communication thread, a cache thread, and the main scheduling thread.

(gdb) thread apply all bt

Thread 12 (Thread 0x2aaaad5e4700 (LWP 8223)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x37026f0) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x2aaaad7e5700 (LWP 8224)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702728) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x2aaaad9e6700 (LWP 8225)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702760) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
---Type <return> to continue, or q <return> to quit---
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x2aaaadbe7700 (LWP 8226)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702798) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x2aaaadde8700 (LWP 8227)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x37027d0) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x2aaaadfe9700 (LWP 8228)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702808) at MTP.c:216
---Type <return> to continue, or q <return> to quit---
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x2aaaae1ea700 (LWP 8229)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702840) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x2aaaae3eb700 (LWP 8230)):
#0  0x00002aaaaacd968c in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x000000000063fc4b in MTPGetRequest (ThreadPool=0x37026f0) at MTP.c:139
#2  0x000000000063fcf8 in MTPHandleRequestsLoop (Data=0x3702878) at MTP.c:216
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x2aaaae5ec700 (LWP 8231)):
#0  0x00002aaaaacd9a5e in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib64/libpthread.so.0
#1  0x00000000004eea5e in MLogQueue::FlushQueueToDisk (this=0x28f60b0)
---Type <return> to continue, or q <return> to quit---
    at MLogQueue.c:196
#2  0x00000000004eea9f in LazyWriteWatchdog (LogQueue=0x28f60b0)
    at MLogQueue.c:40
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x2aaaae7ed700 (LWP 8232)):
#0  0x00002aaaabbc7623 in select () from /lib64/libc.so.6
#1  0x0000000000638daf in MUSleep (SleepDuration=Unhandled dwarf expression opcode 0xf3
) at MTime.c:2101
#2  0x000000000081e3b4 in MSysCommThread () at MSysCommThread.c:790
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x2aaaae9ee700 (LWP 8233)):
#0  0x00002aaaabbc7623 in select () from /lib64/libc.so.6
#1  0x0000000000638daf in MUSleep (SleepDuration=Unhandled dwarf expression opcode 0xf3
) at MTime.c:2101
#2  0x0000000000631031 in MOCacheThread () at MSysObject.c:483
#3  0x00002aaaaacd5aa1 in start_thread () from /lib64/libpthread.so.0
#4  0x00002aaaabbcebcd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x2aaaac0921a0 (LWP 8222)):
#0  0x00002aaaabbc7623 in select () from /lib64/libc.so.6
#1  0x0000000000638daf in MUSleep (SleepDuration=Unhandled dwarf expression opcode 0xf3
) at MTime.c:2101
---Type <return> to continue, or q <return> to quit---
#2  0x000000000066f387 in MUIAcceptRequests (SS=Unhandled dwarf expression opcode 0xf3
) at MUIAcceptRequest.c:501
#3  0x000000000062f06d in MSysMainLoop () at MSysMainLoop.c:1448
#4  0x0000000000410484 in main (ArgC=1, ArgV=0x7fffffffe658, 
    EnvP=0x7fffffffe668) at MServer.c:289
(gdb) 

You can also detect thread (LWP) ids in the log.
Tags: multithreaded, threaded, threads
Last update:
2018-04-17 18:12
Author:
Shawn Hoopes
Revision:
1.0
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags