Sponsored Content
Full Discussion: pthread and mutex question
Top Forums Programming pthread and mutex question Post 302371567 by Neo on Sunday 15th of November 2009 05:40:04 PM
Old 11-15-2009
It might help (debug) if you printed the structural elements of args inside your void *print_the_arguments(void *arguments).
 

10 More Discussions You Might Find Interesting

1. Programming

Threads and Mutex

Hi all, I am working in a UNIX/C environment. I would like to understand more about MUTEX and Threads. Can someone explain me these concepts and how they are related. Vijay (2 Replies)
Discussion started by: vthasan
2 Replies

2. UNIX for Dummies Questions & Answers

mutex

Can anyone explain me what mutexes are in multithreading environment? (2 Replies)
Discussion started by: sagar
2 Replies

3. AIX

pthread lock question

Is it possible that the function "pthread_cond_broadcast" block itself and the function "pthread_cond_wait" unblock in multi-threads programming ? The operating system is AIX 5.2, its maintenance level is : 5.2.0.4, VisualAge C++ 6.0. Thanks (0 Replies)
Discussion started by: Frank2004
0 Replies

4. AIX

pthread performance question

Running dedicated on AIX with 4 processors, creating 4 threads, each with equal work to do, only runs about 20% faster than 1 thread with all of the work. Test case has no blocking but does share memory for read access only. Any ideas why I'm only seeing 20% gain? Is this typical on AIX? ... (1 Reply)
Discussion started by: ldarden
1 Replies

5. Programming

a question about pthread performance

Hello, I run my pthread code on Linux with 4 processors. However, the speed up is only 2 times. The code is about solving equation (G+s(i)C)z(i)=B*us(i), i=1,...,n. Here G,C are m*m matrix, B*us(i) is a m*1 vector and s(i) are n different numbers. I need to solve the equation n times to... (1 Reply)
Discussion started by: mgig
1 Replies

6. Programming

Mutex will not work

I am trying to use mutex in my multi-tread project, but they don't seem to work. I have created a simple demonstration of the problem. This is NOT how I would use a mutex, only a demonstration of the problem: #include <stdio.h> #include <pthread.h> int main() { int val; ... (3 Replies)
Discussion started by: ChrisWilliams
3 Replies

7. Programming

Mutex lock question

Hi all, I have a scenario where I need to use the mutex locks. The mutex locks are working fine, but sometimes I am getting into the dead lock situation. Below is the summary of my code : MUTEX LOCK performTask(); MUTEX UNLOCK. In some cases I get into the situation where... (2 Replies)
Discussion started by: cjjoy
2 Replies

8. Programming

Number of threads waiting on a pthread mutex/rwlock

Using pthreads is there a way to determine how many threads are waiting on a locked resource? I mean, once a shared resource is protected using e.g. pthread_rwlock_t or pthread_mutex_t one thread grabs the lock and other threads will go to sleep waiting for the resource to be available again. Is... (0 Replies)
Discussion started by: muggu
0 Replies

9. Programming

Question (pthread): How to Signal all threads w/o "broadcast"?

Hello all, Is there any way that I can signal (wake) all threads that I have created without using pthread_cond_broadcast? Cheers! Aaron (6 Replies)
Discussion started by: mobility
6 Replies

10. Programming

pthread question : global variable not updated

Hi, I wrote the following program to understand mutexes. If I run the program , number of threads is shown as zero, even after creating one thread. When running with gdb, it works fine. The function process is used to update global variable (used to keep track of threads). It looks like the... (2 Replies)
Discussion started by: sanjayc
2 Replies
vsyslog(3C)						   Standard C Library Functions 					       vsyslog(3C)

NAME
vsyslog - log message with a stdarg argument list SYNOPSIS
#include <syslog.h> #include <stdarg.h> void vsyslog(int priority, const char *message, va_list ap); DESCRIPTION
The vsyslog() function is identical to syslog(3C), except that it is called with an argument list as defined by <stdarg.h> rather than with a variable number of arguments. EXAMPLES
Example 1 Use vsyslog() to write an error routine. The following example demonstrates the use of vsyslog() in writing an error routine. #include <syslog.h> #include <stdarg.h> /* * error should be called like: * error(pri, function_name, format, arg1, arg2...); */ void error(int pri, char *function_name, char *format, ...) { va_list args; va_start(args, format); /* log name of function causing error */ (void) syslog(pri, "ERROR in %s.", function_name); /* log remainder of message */ (void) vsyslog(pri, format, args); va_end(args); (void) abort( ); } main() { error(LOG_ERR, "main", "process %d is dying", getpid()); } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
syslog(3C), attributes(5) SunOS 5.11 30 Aug 2006 vsyslog(3C)
All times are GMT -4. The time now is 08:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy