D create many thread

Eko Wahyudin eko.wahyudin at yahoo.co.id
Wed Feb 5 13:05:59 UTC 2020


Hi all,

I'm create a small (hallo world) application, with DMD.
But my program create 7 annoying threads when create an empty 
class.

What is this thread for?
and is it normal in D?

Below the stack trace of thread creation.

#0  0x00007ffff7f637a0 in pthread_create@@GLIBC_2.2.5 () from 
/usr/lib/libpthread.so.0
#1  0x00005555557388d0 in 
core.thread.osthread.createLowLevelThread(void() nothrow 
delegate, uint, void() nothrow delegate) ()
#2  0x0000555555731384 in 
_D2gc4impl12conservativeQw3Gcx16startScanThreadsMFNbZv ()
#3  0x00005555557307ba in 
_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm ()
#4  0x000055555572eccc in 
_D2gc4impl12conservativeQw3Gcx10smallAllocMFNbmKmkxC8TypeInfoZPv 
()
#5  0x00005555557346a9 in 
_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12mallocNoSyncMFNbmkKmxC8TypeInfoZPvS_DQEgQEgQEeQEp10mallocTimelS_DQFiQFiQFgQFr10numMallocslTmTkTmTxQCzZQFcMFNbKmKkKmKxQDsZQDl ()
#6  0x000055555572c2fe in 
_D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv ()
#7  0x00005555556cd163 in gc_malloc ()
#8  0x00005555556f529c in 
_D2gc4impl5protoQo7ProtoGC6mallocMFNbmkxC8TypeInfoZPv ()
#9  0x00005555556cd163 in gc_malloc ()
#10 0x00005555556cf55b in _d_newclass ()
#11 0x00005555556669f4 in D main (args=...) at source/app.d:11
(gdb) info threads
   Id   Target Id                                Frame
* 1    Thread 0x7ffff7c1ea40 (LWP 8288) "jala2" 
0x00007ffff7f637a0 in pthread_create@@GLIBC_2.2.5 () from 
/usr/lib/libpthread.so.0
   2    Thread 0x7ffff7fcc700 (LWP 8289) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0
   3    Thread 0x7ffff7fc7700 (LWP 8317) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0
   4    Thread 0x7ffff7fc2700 (LWP 8329) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0
   5    Thread 0x7ffff7fbd700 (LWP 8439) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0
   6    Thread 0x7ffff7fb8700 (LWP 8445) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0
   7    Thread 0x7ffff7fb3700 (LWP 8463) "jala2" 
0x00007ffff7f69c45 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/usr/lib/libpthread.so.0


Thank you in advance.


More information about the Digitalmars-d-learn mailing list