473,395 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

IPC: Shared Files vs. Named Pipes

I am making an application in which if the second instance of the same
application is launched, it checks its command-line arguments and
passes them to the already running instance. I have been told by
someone that using named pipes is one of the most commonly used ways
of doing this. But I did it in a simpler way; I saved the command-line
arguments in a text file and passed a message to the previously
running instance to read the arguments from that file. The second
instance then terminates and the first instance deletes the file after
reading the arguments from it. This technique is working perfectly
fine for me, but I was just wondering that are there any drawbacks in
this approach or am I going to get any advantage if I do it using
named pipes?

(I read on support.microsoft (http://support.microsoft.com/kb/q95900)
that shared files is one of the ways for IPC but i am not sure what i
am doing is actually that 'shared files')

Aug 7 '07 #1
2 2513
ajk
On Tue, 07 Aug 2007 08:20:10 -0000, fa*********@gmail.com wrote:
>I am making an application in which if the second instance of the same
application is launched, it checks its command-line arguments and
passes them to the already running instance. I have been told by
someone that using named pipes is one of the most commonly used ways
of doing this. But I did it in a simpler way; I saved the command-line
arguments in a text file and passed a message to the previously
running instance to read the arguments from that file. The second
instance then terminates and the first instance deletes the file after
reading the arguments from it. This technique is working perfectly
fine for me, but I was just wondering that are there any drawbacks in
this approach or am I going to get any advantage if I do it using
named pipes?

(I read on support.microsoft (http://support.microsoft.com/kb/q95900)
that shared files is one of the ways for IPC but i am not sure what i
am doing is actually that 'shared files')
Why don't you just pass the cmdline arguments with the message?
Stuffing everything into a string, marshaling it and then sending it
to the other process should be a simple matter. I think frankly using
named pipes or shared memory is overkill in your case.

I am not quite sure about what environment you run in like security
requirements etc however generally I don't think it is a good idea to
do as you have done. It is better to keep everything inside the app.

hth/ajk
Aug 7 '07 #2

<fa*********@gmail.comwrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
>I am making an application in which if the second instance of the same
application is launched, it checks its command-line arguments and
passes them to the already running instance. I have been told by
someone that using named pipes is one of the most commonly used ways
of doing this. But I did it in a simpler way; I saved the command-line
arguments in a text file and passed a message to the previously
running instance to read the arguments from that file. The second
instance then terminates and the first instance deletes the file after
reading the arguments from it. This technique is working perfectly
fine for me, but I was just wondering that are there any drawbacks in
this approach or am I going to get any advantage if I do it using
named pipes?
Well, what is the third instance going to do? Overwrite the file made by
the second instance?
>
(I read on support.microsoft (http://support.microsoft.com/kb/q95900)
that shared files is one of the ways for IPC but i am not sure what i
am doing is actually that 'shared files')

Aug 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: piyush | last post by:
Sorry for repeated posting but I couldnt get things right/completely in the first post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
0
by: piyush | last post by:
Sorry for repeated posts, I couldnt get things right and complete in the previous post. I am in the process of deciding the IPC mechanisms to use for communication between 1) An application...
2
by: J | last post by:
Hello, What is the best/easiest way to setup interprocess communication between a windows service and a webservice? The windows service will be running on the same machine that is hosting the...
2
ipc
by: Dave | last post by:
Hi, What is the best way to communicate betwine c# application and unmanage c++ application (no sockets) and to pass data betwine them??? what are the all ways i can use?? Thaks
0
by: Federico Caselli | last post by:
Hi, I need to communicate between two processes. I tryed using named pipes, but I'm afraid it's too complex for me... I'd like to explain what I need. The two processes must just exchange an...
10
by: Oriane | last post by:
Hello, I have to share a object in RAM between several processes. I intend to design a special process to load this objet (an Autocad plan) in memory, and to take care of the read/write...
7
by: Alex Y Wang | last post by:
Hi all, my current project is completely written in native C++, and for some reason I need to write a standalone .Net program to do some work for it. Therefore, I need to find an effective way of...
7
by: adrin | last post by:
Hello, Could anybody tell me what are IPC mechanisms that .NET supports at present?(and what improvements were made in different framework versions)? Is IPC support windows dependent or is it...
2
by: Bob | last post by:
The question about IPC between managed vs unmanaged comes up once in a while, and I generally see "Named Pipes" as the answer. But I was wondering if there is anything new. The app in this case...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.