Thread View: comp.sys.sequent
1 messages
1 total messages
Started by Phil Howard KA9WGN
Mon, 12 Nov 1990 20:14
parallel file open
Author: Phil Howard KA9WGN
Date: Mon, 12 Nov 1990 20:14
Date: Mon, 12 Nov 1990 20:14
29 lines
1716 bytes
1716 bytes
I have run into what looks like a bug in UNIX or Dynix. Can anyone tell me if they have seen this before? I start up two processes in parallel. Each process is supposed to open the same file for writing with truncation. However the results are inconsistent. Consider this csh command: ( echo 1 >! test ) & ( echo 2 >! test ) & What should I expect to happen? I usually see only the number 2 written to the file, but sometimes I see BOTH 1 and 2 written. It seems as if what is happening is that the file is being truncated and then appended, and that there is only one distinct file position instead of two separate ones. This happens only about 4% of the time, which is consistent with mere timing. I could only get this problem to occur on the Sequent here, but not on Convex or VAX (but I only tried the above command as a test 100 times). If this is an expected behaviour of UNIX, then I really need not bother with any more testing. I would like to find a way to syncronize two or more processes in the following way. I only want one of the processes to run. The others should detect that they don't need to run, should they happen to get started up in parallel. -- --Phil Howard, KA9WGN-- | Individual CHOICE is fundamental to a free society <phil@ux1.cso.uiuc.edu> | no matter what the particular issue is all about.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads