Sponsored Content
Top Forums Shell Programming and Scripting Measure thread execution (in C, unix) Post 302507312 by Corona688 on Wednesday 23rd of March 2011 12:33:47 PM
Old 03-23-2011
So, something to count CPU time the thread has spent running since last, but not count time the thread has spent suspended?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CPU load unit of measure?

If unix says my cpu load is 2.15 exactly what does that mean? --Jason (1 Reply)
Discussion started by: Mac J
1 Replies

2. Forum Support Area for Unregistered Users & Account Problems

How to post a new thread (Regarding Unix related doubts) in Unix Forums

How to post a new thread (Regarding Unix related doubts) in Unix Forums. I registered my id but I am unable to post my Questions to Forum. Thanks & Regards, indusri (1 Reply)
Discussion started by: indusri
1 Replies

3. Shell Programming and Scripting

Is there a command to measure compile speed?

Hello Ive written 2 programs in shell and I need to compare their speed (Compile) against one another. what methods could I go about doing this? Is there a feature in shell do accommodate this? (2 Replies)
Discussion started by: Darklight
2 Replies

4. UNIX for Advanced & Expert Users

How to measure g++ performance?

I am working on an application with some rather interesting build performance issues. If we build on Solaris/Linux x86/AMD64 the build is rather fast, but it takes more than five times as long on our Solaris Sparc servers (single-threaded builds on the workstations, but multi-threaded on the... (5 Replies)
Discussion started by: Elric of Grans
5 Replies

5. Solaris

What exactly does 'zpool iostat' measure?

hi there, i'd like to know what exactly zpool's iostat (-v) output measure, especially the writes. Is it only the writes to the ZIL or all writes (including commmits) to the disks? if anyone knows, that'd be helpful roti (1 Reply)
Discussion started by: rotunda
1 Replies

6. UNIX for Advanced & Expert Users

Implementing thread in UNIX

Hi For our load testing , we are using stubs (unix shell script) which send the response to the request coming from the application. As the unix stub is single threaded , it is responding to only one request whereas multiple requests come in parallely. I haven't worked on thread concepts... (5 Replies)
Discussion started by: jenanee
5 Replies

7. AIX

How to measure waiting time in run queue?

Hello guys, I am doing a performance analysis on one of our psystem. Most of time I am using Nmon analyser to do my trend graph. But I can't find any help with it. We are interesting in the time spend by tasks in Aix run queue. After looking the Aix documentation, I am pessimist to find any... (3 Replies)
Discussion started by: GiiGii
3 Replies

8. Solaris

How to measure IOPS?

Hi I have a system running solaris 10, and I intend to use a NetApp as its storage system. The application requires a throughput between the server and the storage 7000 disk IOPS (random IO sustained throughput with response time of 20 mili second and 16k block size). How to make sure that I... (6 Replies)
Discussion started by: fretagi
6 Replies

9. Shell Programming and Scripting

Python Thread Execution Issue . . .

Greetings! I set up a basic threading specimen which does the job:#!/usr/bin/python import threading class a(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): print("thread a finished") class b(threading.Thread): ... (0 Replies)
Discussion started by: LinQ
0 Replies
pthread_resume_np(3T)													     pthread_resume_np(3T)

NAME
pthread_resume_np(), pthread_continue(), pthread_suspend() - resume execution of a thread, continue execution of a thread, and suspend exe- cution of a thread SYNOPSIS
PARAMETERS
thread whose execution is to be suspended or resumed. flags Flags to be used by The valid values are: The target thread's suspension count is decremented by one. If the target thread was suspended and has a suspend count greater than one, the thread will not resume execution. The target thread's suspension count is set to zero. The target will resume execution even if its suspend count was greater than one. DESCRIPTION
The function suspends execution of the target thread specified by thread. The target thread may not be suspended immediately (at that exact instant). On successful return from the function, thread is no longer executing. Once a thread has been suspended, subsequent calls to the function increment a per thread suspension count and return immediately. Calling with the calling thread specified in thread is allowed. Note that in this case the calling thread shall be suspended during execu- tion of the function call and shall only return after another thread has called the or function for thread. The function resumes the execution of the target thread thread. If thread was suspended by multiple calls to only one call to is required to resume the execution of thread. Calling for a target thread that is not suspended shall have no effect and return no errors. Calling is equivalent to calling with the flags parameter specified as The function resumes the execution of the target thread specified by thread. If the flags argument is the target thread's suspension count is decremented by one. If the flags argument is the target thread's suspension count is set to zero. When the target thread's suspension count reaches zero, the target thread is allowed to continue execution. Calling for a target thread that is not suspended shall have no effect and return no errors. WARNING
This warning is applicable if any of the following conditions is true for a threaded application: a. The or environment variable is set to either or b. The application's binary is brought forward from a HP-UX 11i v1 release. In either of the above conditions, it is strongly recommended to set the environment variable to if the application uses which is not POSIX compliant. Failing to do so, can lead to undefined behavior. RETURN VALUE
If successful, and return zero. Otherwise, an error number shall be returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number. [ESRCH] The target thread thread is not in the current process. [EDEADLK] The target thread thread is the last running thread in the process. The operation would result in deadlock for the process. If any of the following occur, the and functions return the corresponding error number. [ESRCH] The target thread thread is not in the current process. [EINVAL] The value specified by flags is invalid. APPLICATION USAGE
This functionality enables a process that is multithreaded to temporarily suspend all activity to a single thread of control. When the process is single threaded, the address space is not changing, and a consistent view of the process can be gathered. One example of its use is for garbage collecting. The garbage collector runs asynchronously within the process and assumes that the process is not changing while it is running. Suspending a thread may have adverse effects on an application. If a thread is suspended while it holds a critical resource, such as a mutex or a read-write lock, the application may stop or even deadlock until the thread is continued. While the thread is suspended, other threads which may contend for the same resource must block until the thread is continued. Depending on application behavior, this may even result in deadlock. Application programmers are advised to either a) only suspend threads which call async-signal safe functions or b) ensure that the suspending thread does not contend for the same resources that the suspended thread may have acquired. Note: this includes resources that may be acquired by libraries. The and functions cannot reliably be used for thread synchronization. Synchronization primitives like mutexes, semaphores, read-write locks, and condition variables should be used instead. AUTHOR
and were developed by X/Open. was developed by HP. SEE ALSO
pthread_create(3T). STANDARDS CONFORMANCE
Pthread Library pthread_resume_np(3T)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy