06-11-2013
Yes Rudic..you have correctly pointed these points.
I can understand these are the problem in this code.
But i m not able to enhance the code to avoid these.
Can you pls suggest what kind of code change i can do for this.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
how does the Unix File System perform with large directories (containing ~30.000 files)?
What kind of structure is used for the organization of a directory's content, linear lists, (binary) trees?
I hope the description 'Unix File System' is exact enough, I don't know more about the file... (3 Replies)
Discussion started by: dive
3 Replies
2. Shell Programming and Scripting
I found another problem with my disk-adding script today. When looking for disks, I use grep.
When I grep for the following disk sizes:
5242880
I also pick up these as well:
524288000
How do I specifically pick out one or the other, using grep, without resorting to the -v option?
... (9 Replies)
Discussion started by: LinuxRacr
9 Replies
3. Shell Programming and Scripting
Hello Gurus,
We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this .
Problem Definition:
/Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies
4. Shell Programming and Scripting
I have the following problem:
I have two files: S containing sentences (one in each row) and W containing files (one in each row). It might look like this:
S:
a b c apple d.
e f orange g.
h banana i j.
W:
orange
banana
apple
My task is to replace in S all words that appear in W... (2 Replies)
Discussion started by: tootles564
2 Replies
5. Shell Programming and Scripting
Background
-------------
The Unix flavor can be any amongst Solaris, AIX, HP-UX and Linux. I have below 2 flat files.
File-1
------
Contains 50,000 rows with 2 fields in each row, separated by pipe.
Row structure is like Object_Id|Object_Name, as following:
111|XXX
222|YYY
333|ZZZ
... (6 Replies)
Discussion started by: Souvik
6 Replies
6. Red Hat
Hi,
I've some directory that I used as working directory for a program. At the end of the procedure, the content is deleted. This directory, when I do a ls -l, appears to still take up some space. After a little research, I've seen on a another board of this forum that it's not really taking... (5 Replies)
Discussion started by: bdx
5 Replies
7. Shell Programming and Scripting
Hi All,
I need help to know the exact command when I grep large list of files. Either using ls or find command. However I do not want to find in the subdirectories as the number of subdirectories are not fixed. How do I achieve that.
I want something like this:
find ./ -name "MYFILE*.txt"... (2 Replies)
Discussion started by: angshuman
2 Replies
8. Shell Programming and Scripting
I want to extract verbal forms from a large corpus of English. I have identified a certain number of patterns. Each pattern has the following structure
SPACE word_CATEGORY
where word refers to the verbal form and CATEGORY refers to the class of the verb
The categories are identified as per the... (4 Replies)
Discussion started by: gimley
4 Replies
9. Shell Programming and Scripting
Hello,
For several of our scripts we are using awk to search patterns in files with data from other files. This works almost perfectly except that it takes ages to run on larger files. I am wondering if there is a way to speed up this process or have something else that is quicker with the... (15 Replies)
Discussion started by: SDohmen
15 Replies
LEARN ABOUT DEBIAN
pthread_mutexattr_gettype
PTHREAD_MUTEXATTR(3) Library Functions Manual PTHREAD_MUTEXATTR(3)
NAME
pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_settype, pthread_mutexattr_gettype - mutex creation attributes
SYNOPSIS
#include <pthread.h>
int pthread_mutexattr_init(pthread_mutexattr_t *attr);
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind);
DESCRIPTION
Mutex attributes can be specified at mutex creation time, by passing a mutex attribute object as second argument to pthread_mutex_init(3).
Passing NULL is equivalent to passing a mutex attribute object with all attributes set to their default values.
pthread_mutexattr_init initializes the mutex attribute object attr and fills it with default values for the attributes.
pthread_mutexattr_destroy destroys a mutex attribute object, which must not be reused until it is reinitialized. pthread_mutexattr_destroy
does nothing in the LinuxThreads implementation.
LinuxThreads supports only one mutex attribute: the mutex kind, which is either PTHREAD_MUTEX_FAST_NP for ``fast'' mutexes,
PTHREAD_MUTEX_RECURSIVE_NP for ``recursive'' mutexes, or PTHREAD_MUTEX_ERRORCHECK_NP for ``error checking'' mutexes. As the NP suffix
indicates, this is a non-portable extension to the POSIX standard and should not be employed in portable programs.
The mutex kind determines what happens if a thread attempts to lock a mutex it already owns with pthread_mutex_lock(3). If the mutex is of
the ``fast'' kind, pthread_mutex_lock(3) simply suspends the calling thread forever. If the mutex is of the ``error checking'' kind,
pthread_mutex_lock(3) returns immediately with the error code EDEADLK. If the mutex is of the ``recursive'' kind, the call to
pthread_mutex_lock(3) returns immediately with a success return code. The number of times the thread owning the mutex has locked it is
recorded in the mutex. The owning thread must call pthread_mutex_unlock(3) the same number of times before the mutex returns to the
unlocked state.
The default mutex kind is ``fast'', that is, PTHREAD_MUTEX_FAST_NP.
pthread_mutexattr_settype sets the mutex kind attribute in attr to the value specified by kind.
pthread_mutexattr_gettype retrieves the current value of the mutex kind attribute in attr and stores it in the location pointed to by kind.
RETURN VALUE
pthread_mutexattr_init, pthread_mutexattr_destroy and pthread_mutexattr_gettype always return 0.
pthread_mutexattr_settype returns 0 on success and a non-zero error code on error.
ERRORS
On error, pthread_mutexattr_settype returns the following error code:
EINVAL kind is neither PTHREAD_MUTEX_FAST_NP nor PTHREAD_MUTEX_RECURSIVE_NP nor PTHREAD_MUTEX_ERRORCHECK_NP
AUTHOR
Xavier Leroy <Xavier.Leroy@inria.fr>
SEE ALSO
pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_unlock(3).
LinuxThreads PTHREAD_MUTEXATTR(3)