07-07-2005
iowait function call
Hi all,
I have an Producer/Consumer program in C(using shared memory and semaphores).It is working fine with sleep calls after every read/write operation.Each one is a independent program.Now if i remove the sleep calls in consumer,it goes on waiting in the loop till the producer puts some valid data.Instead of doing this i was asked to call iowait() I am not aware how to use this function.Can anyone suggest some link abt this call and how to use it in the code.
Thanx in advance
Poorni
10 More Discussions You Might Find Interesting
1. Programming
The intention of the program. Create N threads with 2 shared memories.
One shared memory to write, one shared memory to recieve.
Consumer creates 2 shared memory to share with producer.
I need H threads for the producer as well(somebody help on it..)
Also another question, would segment_id... (2 Replies)
Discussion started by: joey
2 Replies
2. UNIX for Dummies Questions & Answers
I would like to loop through a set of directories, performing operation(s) on each one. The basic script** is
dirs=`find . -name .svn -print`
for f in $dirs; do
echo "Processing $f directory .."
done
Fine and dandy, but here is the problem: the find expression must complete... (2 Replies)
Discussion started by: jakeo25
2 Replies
3. UNIX for Dummies Questions & Answers
I would like to loop through a set of directories, performing operation(s) on each one. The basic script** is
dirs=`find . -name .svn -print`
for f in $dirs; do
echo "Processing $f directory .."
done
Fine and dandy, but here is the problem: the find expression must complete... (7 Replies)
Discussion started by: jakeo25
7 Replies
4. Programming
Control two exclusively shared resources. The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the code.
... (0 Replies)
Discussion started by: gokult
0 Replies
5. Shell Programming and Scripting
Control two exclusively shared resources. The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the code.
... (1 Reply)
Discussion started by: gokult
1 Replies
6. UNIX for Advanced & Expert Users
Control two exclusively shared resources(semaphore). The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the... (0 Replies)
Discussion started by: gokult
0 Replies
7. Programming
Control two exclusively shared resources(semaphore). The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the... (0 Replies)
Discussion started by: gokult
0 Replies
8. UNIX for Dummies Questions & Answers
Control two exclusively shared resources. The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the code.
... (3 Replies)
Discussion started by: gokult
3 Replies
9. Homework & Coursework Questions
Control two exclusively shared resources(semaphore). The two resources are two files. The producer will write even numbers to one file, and odd numbers to another one. The consumer respectively reads from each file until it gets 5 even numbers and 5 odd numbers.
Can any one help me with the... (1 Reply)
Discussion started by: gokult
1 Replies
10. UNIX for Dummies Questions & Answers
normally, i hate asking someone to do my homework for me but am getting desperate right now.
i have a project about consumer producer problem. the deadline is tonight at 23:55. but i havent gotten it working yet. i just COULDNT get it to work right yet.
the problem is as follows: the C - program... (0 Replies)
Discussion started by: alexantosh
0 Replies
LEARN ABOUT SUNOS
dat_cno_query
dat_cno_query(3DAT) Direct Access Transport Library Functions dat_cno_query(3DAT)
NAME
dat_cno_query - provide the Consumer parameters of the CNO
SYNOPSIS
cc [ flag... ] file... -ldat [ library... ]
#include <dat/udat.h>
DAT_RETURN
dat_cno_query (
IN DAT_CNO_HANDLE cno_handle,
IN DAT_CNO_PARAM_MASK cno_param_mask,
OUT DAT_CNO_PARAM *cno_param
)
PARAMETERS
cno_handle Handle for the created instance of the Consumer Notification Object
cno_param_mask Mask for CNO parameters
cno_param Pointer to a Consumer-allocated structure that the Provider fills with CNO parameters
DESCRIPTION
The dat_cno_query() function provides the Consumer parameters of the CNO. The Consumer passes in a pointer to the Consumer-allocated struc-
tures for CNO parameters that the Provider fills.
The cno_param_mask parameter allows Consumers to specify which parameters to query. The Provider returns values for cno_param_mask
requested parameters. The Provider can return values for any other parameters.
A value of DAT_OS_WAIT_PROXY_AGENT_NULL in cno_param indicates that there are no Proxy Agent associated with the CNO.
RETURN VALUES
DAT_SUCCESS The operation was successful.
DAT_INVALID_PARAMETER The cno_param_mask parameter is invalid.
DAT_INVALID_HANDLE The cno_handle parameter is invalid.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard: uDAPL, 1.1, 1.2 |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
libdat(3LIB), attributes(5)
SunOS 5.10 16 Jul 2004 dat_cno_query(3DAT)