Sponsored Content
Full Discussion: SpinLocks usage example
Top Forums UNIX for Advanced & Expert Users SpinLocks usage example Post 302420826 by methyl on Wednesday 12th of May 2010 01:44:23 PM
Old 05-12-2010
Google, Ask Jeeves and Bing all give good answers when given your post.
 

10 More Discussions You Might Find Interesting

1. Programming

Monitor CPU usage and Memory Usage

how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries through a c program or java program i want to store that data into database so i can show it graphically thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies

2. Programming

CPU usage and memory usage

Please tell me solaris functions/api for getting following information 1- Function that tells how much memory used by current process 2- Function that tells how much memory used by all running processes 3- Function that tells how much CPU is used by current process 4- Function that tells how... (1 Reply)
Discussion started by: mansoorulhaq
1 Replies

3. UNIX for Advanced & Expert Users

usage of ps -ef

Hi, I can have only one instance of my script running at any point of time. So I have : SCRIPT_NAME=$0 if ; then echo "The process $0 is already running. Aborting the current instance of the job $0" exit 1 fi And in the last line of the script i had given exit 0 At times, though... (3 Replies)
Discussion started by: risshanth
3 Replies

4. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

5. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

6. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

7. Shell Programming and Scripting

Confused with the usage of one variable usage

Hi All I am not able to understand the usage of d# in the below variable declaration. FILE_LOC contains the directory path And also help me to know about what will be saved in the variable j. Thanks!!! j=${d#${FILE_LOC}/} (2 Replies)
Discussion started by: mohanm
2 Replies

8. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

9. Shell Programming and Scripting

Usage of $(

I recently came across this construct that i am not able to understand. ex: cat $(grep -l 'HELLO' *) the above command prints out the contents of the file if HELLO string is present in the file. I am not able to understand the usage of "$(" here.. can anybody help me understand this? $anything... (2 Replies)
Discussion started by: sreeharshasn
2 Replies

10. UNIX for Dummies Questions & Answers

Memory usage per user,percent usage,sytem time in ksh

Let's say i have 20 users logged on Server. How can I know how much memory percent used each of them is using with system time in each user? (2 Replies)
Discussion started by: roy1912
2 Replies
MTX_POOL(9)						   BSD Kernel Developer's Manual					       MTX_POOL(9)

NAME
mtx_pool, mtx_pool_alloc, mtx_pool_find, mtx_pool_lock, mtx_pool_lock_spin, mtx_pool_unlock, mtx_pool_unlock_spin, mtx_pool_create, mtx_pool_destroy -- mutex pool routines SYNOPSIS
#include <sys/param.h> #include <sys/lock.h> #include <sys/mutex.h> struct mtx * mtx_pool_alloc(struct mtx_pool *pool); struct mtx * mtx_pool_find(struct mtx_pool *pool, void *ptr); void mtx_pool_lock(struct mtx_pool *pool, void *ptr); void mtx_pool_lock_spin(struct mtx_pool *pool, void *ptr); void mtx_pool_unlock(struct mtx_pool *pool, void *ptr); void mtx_pool_unlock_spin(struct mtx_pool *pool, void *ptr); struct mtx_pool * mtx_pool_create(const char *mtx_name, int pool_size, int opts); void mtx_pool_destroy(struct mtx_pool **poolp); DESCRIPTION
Mutex pools are designed to be used as short term leaf mutexes; i.e., the last mutex one might acquire before calling mtx_sleep(9). They operate using a shared pool of mutexes. A mutex may be chosen from the pool based on a supplied pointer, which may or may not point to any- thing valid, or the caller may allocate an arbitrary shared mutex from the pool and save the returned mutex pointer for later use. The shared mutexes in the mtxpool_sleep mutex pool, which is created by default, are standard, non-recursive, blockable mutexes, and should only be used in appropriate situations. The mutexes in the mtxpool_lockbuilder mutex pool are similar, except that they are initialized with the MTX_NOWITNESS flag so that they may be used to build higher-level locks. Other mutex pools may be created that contain mutexes with dif- ferent properties, such as spin mutexes. The caller can lock and unlock mutexes returned by the pool routines, but since the mutexes are shared, the caller should not attempt to destroy them or modify their characteristics. While pool mutexes are normally leaf mutexes (meaning that one cannot depend on any ordering guarantees after obtaining one), one can still obtain other mutexes under carefully controlled circumstances. Specifically, if one has a private mutex (one that was allocated and initialized by the caller), one can obtain it after obtaining a pool mutex if ordering issues are carefully accounted for. In these cases the private mutex winds up being the true leaf mutex. Pool mutexes have the following advantages: 1. No structural overhead; i.e., they can be associated with a structure without adding bloat to it. 2. Mutexes can be obtained for invalid pointers, which is useful when one uses mutexes to interlock destructor operations. 3. No initialization or destruction overhead. 4. Can be used with mtx_sleep(9). And the following disadvantages: 1. Should generally only be used as leaf mutexes. 2. Pool/pool dependency ordering cannot be guaranteed. 3. Possible L1 cache mastership contention between CPUs. mtx_pool_alloc() obtains a shared mutex from the specified pool. This routine uses a simple rover to choose one of the shared mutexes man- aged by the mtx_pool subsystem. mtx_pool_find() returns the shared mutex associated with the specified address. This routine will create a hash out of the pointer passed into it and will choose a shared mutex from the specified pool based on that hash. The pointer does not need to point to anything real. mtx_pool_lock(), mtx_pool_lock_spin(), mtx_pool_unlock(), and mtx_pool_unlock_spin() lock and unlock the shared mutex from the specified pool associated with the specified address; they are a combination of mtx_pool_find() and mtx_lock(9), mtx_lock_spin(9), mtx_unlock(9), and mtx_unlock_spin(9), respectively. Since these routines must first find the mutex to operate on, they are not as fast as directly using the mutex pointer returned by a previous invocation of mtx_pool_find() or mtx_pool_alloc(). mtx_pool_create() allocates and initializes a new mutex pool of the specified size. The pool size must be a power of two. The opts argument is passed to mtx_init(9) to set the options for each mutex in the pool. mtx_pool_destroy() calls mtx_destroy(9) on each mutex in the specified pool, deallocates the memory associated with the pool, and assigns NULL to the pool pointer. SEE ALSO
locking(9), mutex(9) HISTORY
These routines first appeared in FreeBSD 5.0. BSD
February 6, 2010 BSD
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy