I have two program problems:
a program that generates this file writing zeros for PID
and TIME and random numbers in the 8 pozitions of the DATA
field.
and
program that will create at least 3 child
processes, each of which will repeat at least 10 times the
following operations on the file given above. Each child
process will generate a random number STEP between 1 and
10. The child process will process all the records on
positions multiple of STEP. Every number in the DATA field
will be added he largest power of 5 smaller than it. The PID
and TIME fields will be modified accordingly. To avoid
interference among the processes, all the records to be
processed will be locked beforehand using lockf(). After the
processing of the records is over, they will be unlocked. Lock
the records in the order they are stored inthe file. Then, try
to lock them in an arbitrary order and possibly add a second
delay after each lock is applied.
baku 0 Newbie Poster
baku 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.