01-16-2006
I should think so... Threads share memory don't they?
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Neo, if I have an old thread that is a few months old, and a few pages back in the forum it was posted in, is it ok to 'bump' it back to the front? or, would you rather i deleted the old thread, and just create a new one? btw the thread has no replies. (2 Replies)
Discussion started by: norsk hedensk
2 Replies
2. Programming
I need to create a shared library to access an in memory DB. The DB is not huge, but big enough to make it cumbersome to carry around in every single process using the shared library. Luckily, it is pretty static information, so I don't need to worry much about synchronizing the data between... (12 Replies)
Discussion started by: DreamWarrior
12 Replies
3. UNIX for Advanced & Expert Users
Hi,
I have a program that has two types of threads:
1) Reader threads
2) Worker Threads
Readers: Their only job is to read files. They just read data from the files and put them into a buffer. They are obviously I/O intensive.
Workers: These are CPU intensive. They do some computation... (5 Replies)
Discussion started by: the_learner
5 Replies
4. UNIX for Advanced & Expert Users
Hi all,
How can I get the list of all Threads and the Total count of threads under a particular process ?
Do suggest !!
Awaiting for the replies !!
Thanks
Varun:b: (2 Replies)
Discussion started by: varungupta
2 Replies
5. Linux
I am looking for C program source code. Could you please help me in finding the source code required mentioned below.
program to create multiple threads (one master thread and rest worker threads) and using the threads write into and read from shared memory
Restrictions:
Only one thread... (0 Replies)
Discussion started by: kumars
0 Replies
6. Programming
I am looking for C program source code. Could you please help me in finding the source code required mentioned below.
program to create multiple threads (one master thread and rest worker threads) and using the threads write into and read from shared memory
Restrictions:
Only one thread... (2 Replies)
Discussion started by: kumars
2 Replies
7. Programming
I am looking for C program source code. Could you please help me in finding the source code required mentioned below.
program to create multiple threads (one master thread and rest worker threads) and using the threads write into and read from shared memory
Restrictions:
Only one thread... (1 Reply)
Discussion started by: kumars
1 Replies
8. Programming
I am writing a shared library in Linux (but compatible with other UNIXes) and I want to allow multiple instances to share a piece of memory -- 1 byte is enough. What's the "best" way to do this? I want to optimize for speed and portability.
Obviously, I'll have to worry about mutual exclusion. (0 Replies)
Discussion started by: otheus
0 Replies
9. Programming
Hello! I started studying studying about POSIX Threads a few days ago... so I am a little confused and I would appreciate some help!
I isolated this code... and I wonder if I could use threads in it!
#include <unistd.h>
#endif
#include <math.h>
//#include "main.h"
#include <sys/time.h>... (1 Reply)
Discussion started by: smurf2
1 Replies
10. Programming
Hello.
I am new to this forum and I would like to ask for advice about low level POSIX programming.
I have to implement a POSIX compliant C shared library.
A file will have some variables and the shared library will have some functions which need those variables.
There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies
LEARN ABOUT OSF1
pthread_rwlockattr_setpshared
pthread_rwlockattr_setpshared(3) Library Functions Manual pthread_rwlockattr_setpshared(3)
NAME
pthread_rwlockattr_setpshared - Sets the process-shared attribute in a read-write lock attributes object.
LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so)
SYNOPSIS
#include <pthread.h>
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared);
PARAMETERS
Address of the read-write lock attributes object whose process-shared attribute is to be set. Value to set in the process-shared attribute
of attr. Must be the value PTHREAD_PROCESS_SHARED, to permit access to the read-write lock by any thread in any process that can access the
memory where the lock object is allocated, or PTHREAD_PROCESS_PRIVATE, to permit access to the read-write lock only by threads in the same
process as the thread that initialized the read-write lock object.
DESCRIPTION
This routine uses the value in pshared to set the process-shared attribute in the read-write lock attributes object referenced by attr. The
object referenced by attr must be initialized before this routine is called. The value of pshared must be either PTHREAD_PROCESS_SHARED or
PTHREAD_PROCESS_PRIVATE, as defined in the pthread.h include file.
If the process-shared attribute is set to PTHREAD_PROCESS_PRIVATE, the read-write lock object can only be operated upon by threads created
within the same process as the thread that initialized the read-write lock object. If threads of differing processes attempt to operate on
such a read-write lock object, the behavior is undefined.
The default value of the process-shared attribute of a read-write lock attributes object is PTHREAD_PROCESS_PRIVATE.
If the process-shared attribute of a read-write lock attributes object is set to PTHREAD_PROCESS_SHARED, the read-write lock object can be
operated upon by any thread that has access to the memory where that object is allocated, even if that object is allocated in memory that
is shared by multiple processes.
RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Successful completion. The value specified by attr is not a valid attributes object, or the value pshared is outside the range of legal
values for that attribute.
ERRORS
None
RELATED INFORMATION
Functions: pthread_rwlockattr_getpshared(3), pthread_rwlockattr_init(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
pthread_rwlockattr_setpshared(3)