I> perl-newbie, so please excuse if this is trivial
I> I need a simple way to write to different offsets of a file in
I> parallel.
I> How can I achieve that with perl?
before you code it in any language, please clarify what your goals
are. why do you need or want to do this? what do you mean by parallel?
anything done is parallel is not simple in general. you need to be much
better at explaining your problem (which is usually half the work in
getting it solved).
uri
Well so here goes
I am trying to write unique pattern to every file block, block size is
512 bytes in this case.
So if do this in perl
my $hell=generate_pattern($file_block_number);
for($i=0;$i<=(total_blocks-1);$i++) {
system("/iotool seek=(512*$i) bs=512 pattern=$hell filename SIZE");
}
Seems to be taking much more time than if I simply fire the command
from the unix command line,
which is pretty obvious.
So, since I have to coding up the i/o part in a perl script, I was
wondering if I could make
this write thingy happen in parallel since I have the benefit of
writing different offsets.
Hope this explains the problem.
thanks again..
_gourab