User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,470 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 436 | Replies: 1
Reply
Join Date: Mar 2008
Posts: 11
Reputation: baku is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
baku baku is offline Offline
Newbie Poster

Blocking unix files problems

  #1  
Apr 25th, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 11
Reputation: baku is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
baku baku is offline Offline
Newbie Poster

Re: Blocking unix files problems

  #2  
Apr 25th, 2008
the file should be a binary file containing 100 records of 38 bytes each
with the following format:

+--------+------+-----------------------------------------------+
| Bytes | Name | Content |
+--------+------------------------------------------------------+
| 0 - 1 | PID | PID of the last modifier process (short int) |
+--------+------+-----------------------------------------------+
| 2 - 5 | TIME | Time of the last chage in milisec (long int) |
+--------+------+-----------------------------------------------+
| 6 - 37 | DATA | Sequence of 8 natural numbers (int) |
+--------+------+-----------------------------------------------+
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 2:29 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC