node.js does have threads under the hood, i.e. fs calles are processed by a threadpool. there is however no public api for thread id detection. only way i could think of currently is to make a system call via shell and parse it out, like 'ps -M | grep '+ process.pid
Am Donnerstag, 13. Februar 2014 13:11:51 UTC+1 schrieb Pawel Por: > > but "ps" linux command shows that my node application consumes 2 threads. > > thanks for reply > > On Thursday, February 13, 2014 1:04:57 PM UTC+1, Alan Hoffmeister wrote: >> >> I think that Node.js don't have threads, so no TID... >> -- >> Att, >> Alan Hoffmeister >> >> >> 2014-02-13 10:01 GMT-02:00 Pawel Por <[email protected]>: >> > Hi >> > >> > How can I print thread id in node js ? >> > I mean thread ID (TID) not process ID (PID). >> > >> > thanks for answer >> > >> > -- >> > -- >> > Job Board: http://jobs.nodejs.org/ >> > Posting guidelines: >> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> > You received this message because you are subscribed to the Google >> > Groups "nodejs" group. >> > To post to this group, send email to [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> > http://groups.google.com/group/nodejs?hl=en?hl=en >> > >> > --- >> > You received this message because you are subscribed to the Google >> Groups >> > "nodejs" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
