Sponsored Content
Full Discussion: thread count
Top Forums Shell Programming and Scripting thread count Post 302324220 by radoulov on Wednesday 10th of June 2009 08:58:35 AM
Old 06-10-2009
You should use something like this:

Code:
 ++$TIDcount 
    if / tid (\d+)/ && !$tidUnique{$1}++;

Given you sample data:

Code:
% perl -nle'
  ++$c if / tid (\d+)/ && !$tid{$1}++;
  print $c if eof
  ' infile
2

 

4 More Discussions You Might Find Interesting

1. Programming

How to cancel a thread safely from the initial thread?

how about asynchronous canceling? or with signal? if with signal whether it effects the process? my english so badly :( :( (1 Reply)
Discussion started by: alan.zhao
1 Replies

2. Solaris

thread count using top

I am running a multithreaded program which creates 10 threads and works away. However, when I use top to monitor my program whilst it is running, it only shows 4 under the thread count! Can anyone explain if this is in fact the number of threads running in my process... (0 Replies)
Discussion started by: supahoop
0 Replies

3. UNIX for Dummies Questions & Answers

Thread count for a process id

Hi, I want to know a command/program to get thread count for a process id in unix box. Please help me in this regard. (1 Reply)
Discussion started by: manaac
1 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies
MYTID(3PVM)							  PVM Version 3.4						       MYTID(3PVM)

NAME
pvm_mytid - Returns the tid of the calling process. SYNOPSIS
C int tid = pvm_mytid( void ) Fortran call pvmfmytid( tid ) PARAMETERS
tid Integer returning the task identifier of the calling PVM process. Values less than zero indicate an error. DESCRIPTION
The routine pvm_mytid enrolls this process into PVM on its first call. It also generates a unique tid if this process was not created by pvm_spawn. pvm_mytid returns the tid of the calling process and can be called multiple times in an application. Any PVM system call (not just pvm_mytid) will enroll a task in PVM if the task is not enrolled before the call. The tid is a 32 bit positive integer created by the local pvmd. The 32 bits are divided into fields that encode various information about this process such as its location in the virtual machine (i.e. local pvmd address), the CPU number in the case where the process is on a multiprocessor, and a process ID field. This information is used by PVM and is not expected to be used by applications. Applications should not attempt to predict or interpret the tid with the exception of calling tidtohost() If PVM has not been started before an application calls pvm_mytid the returned tid will be < 0. EXAMPLES
C: tid = pvm_mytid( ); Fortran: CALL PVMFMYTID( TID ) ERRORS
This error condition can be returned by pvm_mytid PvmSysErr pvmd not responding. SEE ALSO
pvm_tidtohost(3PVM), pvm_parent(3PVM) 30 August, 1993 MYTID(3PVM)
All times are GMT -4. The time now is 05:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy