两个程序与此同时对一个文件分别进行读和写操作,能行吗

两个程序同时对一个文件分别进行读和写操作,能行吗?
我现在需要写一个这样功能的程序(程序A):从另一个程序(程序B)生成的log文件中读出文件内容。程序B是一直运行的,log文件的内容也是不断增加的,我写的程序A也要一直监视log文件,只要内容一变化,马上就要从文件中读取内容。
我现在担心的是出现log文件只能被一个程序使用,另一个程序打开文件时会失败,被提示文件被占用;
还有个问题就是(在文件能同时被两个程序打开的前提下)我的程序A怎么知道log文件的内容变化了,是否需要先关闭文件再打开啊?还是直接读取文件就能读出更新后的内容?
注意是两个不同的程序,不是两个线程。
急需解决,请高手指教
------最佳解决方案--------------------
建议使用内存共享文件或者管道同步两个进程的数据。
------其他解决方案--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        // 上次读取行的索引
        static Int32 iLastIndex;

        static void Display(String path)
        {
            using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                using (StreamReader sr = new StreamReader(fs))
                {
                    Int32 curIndex = 0;
                    String strText = sr.ReadLine();

                    // 路过已经读取的行
                    while (strText != null && iLastIndex != 0 && curIndex++ < iLastIndex)
                    {
                        strText = sr.ReadLine();
                    }

                    // 显示新增行
                    while (strText != null)
                    {
                        iLastIndex++;
                        Console.WriteLine(strText);
                        strText = sr.ReadLine();
                    }
                }