10-24-2005
Quote:
Originally Posted by shilpi_gup
How to implement read/write thread. This has to implemented at server side ar at client side?
Depends on your application.
If the client and server talk to each other then u need to have read, write on both sides.
6 More Discussions You Might Find Interesting
1. Programming
Listener thread is maintained at server side :
I have Implemented as:
/* specify queue */
listen(sockfd, 5);
while (1) {
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd,
(struct sockaddr *) &cli_addr, &clilen);
if... (0 Replies)
Discussion started by: shilpi_gup
0 Replies
2. IP Networking
Hi Friends,
I have written a program which will listener for more than 1000 requests per second from a single socket descriptor and then it will process those requestes. Its taking X amount of time. Now i want to reduce that time. Will I can write multiple threads to receive the... (2 Replies)
Discussion started by: pa.chidhambaram
2 Replies
3. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
4. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
5. Post Here to Contact Site Administrators and Moderators
Hi Neo , I was searching for Unix Certifications on Google and got u r thread:
"unix-certification-most-needed-these-days.html"
It was a gr8 read. Nice to know ur thoughts.. I m also a newbie to this Unix world and had a gr8 interst in it. I m learning shell scripting and other basics. Would... (2 Replies)
Discussion started by: paras.oriental
2 Replies
6. Shell Programming and Scripting
Hi This is continuation of previos thread
status=running
username=abc
password=123456
server=linux
The script was made which is used to capture the data from file
./scr test status
It will give result running
I have a case like
status = running
username=abc
password=123456... (14 Replies)
Discussion started by: parthmittal2007
14 Replies
LEARN ABOUT OSF1
pthread_rwlock_trywrlock
pthread_rwlock_trywrlock(3) Library Functions Manual pthread_rwlock_trywrlock(3)
NAME
pthread_rwlock_trywrlock - Attempts to acquire a read-write lock for write access without waiting.
LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so)
SYNOPSIS
#include <pthread.h>
int pthread_rwlock_trywrlock(
pthread_rwlock_t *rwlock);
PARAMETERS
Address of the read-write lock object to acquire for write access.
DESCRIPTION
This routine attempts to acquire the read-write lock referenced by rwlock for write access. If any thread already holds that lock for write
access or read access, this routine fails and returns [EBUSY] and the calling thread does not wait for the lock to become available.
Results are undefined if the calling thread holds the read-write lock (whether for read or write access) at the time this routine is
called.
If the read-write lock object referenced by rwlock is not initialized, the results of calling this routine are undefined.
Realtime applications can encounter priority inversion when using read-write locks. The problem occurs when a high-priority thread acquires
a read-write lock that is about to be unlocked (that is, posted) by a low-priority thread, but the low-priority thread is preempted by a
medium-priority thread. This scenario leads to priority inversion in that a high-priority thread is blocked by lower-priority threads for
an unlimited period of time. During system design, realtime programmers must take into account the possibility of priority inversion and
can deal with it in a number of ways, such as by having critical sections that are guarded by read-write locks execute at a high priority,
so that a thread cannot be preempted while executing in its critical section.
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 read-write lock could not be acquired for write access because it was already locked for write access or for
read access. The value specified by rwlock does not refer to an initialized read-write lock object. The current thread already owns the
read-write lock for write or read access.
ERRORS
None
RELATED INFORMATION
Functions: pthread_rwlock_init(3), pthread_rwlockattr_init(3), pthread_rwlock_rdlock(3), pthread_rwlock_wrlock(3), pthread_rwlock_unlock(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
pthread_rwlock_trywrlock(3)