Re: off topic: combined output of concurrent processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 14, 2012 at 01:35:38AM +0000, Amadeus W.M. wrote:
> So here is the question. Suppose I have several processes that run 
> concurrently and each outputs stuff to stdout. Can the combined output be 
> intermingled? 

If you just send the output to a file, you've no way of knowing exactly
when it will be output, or whether it will be buffered before writing.
You can mitigate this a bit by making every output line have a sequence and
process identifier--the PID and date in seconds would work--so you could
separate the streams later.

If you really would like to get output in sequence, write to a pipe, and
have a reader process drain the pipe to a logfile.  It's pretty easy; look
at "mknod" with the 'p' option, or "mkfifo".  I'd still suggest tagging
each output line with an identifier and sequence number.

Cheers,
--
	Dave Ihnat
	dihnat@xxxxxxxxxx
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux