Support for interactive tasks.
Review Request #214 - Created June 24, 2012 and updated - Latest diff uploaded
Information | |
---|---|
Bogdan-Cristian Tătăroiu | |
infoarena | |
Reviewers | |
hackers | |
This majority of this diff is the result of a 3 hour plane trip to LHR. :) Communication between the user and interactive process is achieved using named pipes (also known as fifos). Named pipe are created using mkfifo and refered to as paths on the file system. Once a process opens the fifo for reading and another for writing, they are interconnected using the same mechanism as anonymous pipes, used by every other judge out there. Named pipes were used because they required significantly less actual changes to jrun. A jail folder will have this structure: - interact (executable) - interact.in (symbolic link to user/user.out) - interact.out (symbolic link to user/user.in) - user (folder) -- user_{jobid}_{testno} (executable) -- user.in (fifo) -- user.out (fifo) This means that the user executable will not have access to the interact process, but the interact process will have access to the users jail. This can be useful for providing data files for example. The performance observed while running through jrun with '--no-ptrace' was identical to what I've seen using an anonymous pipe system, which is to be expected. Without '--no-ptrace' however, performance suffers greatly, which is worrying and *needs* to be investigated. For this reason alone, this should be considered experimental for now.