Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 7 Jul 2004 22:13:24 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Shared information between process Message-ID: <20040708021324.GB9867@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <6334E09627481B4AA5C8DE1E69E19D3B013BA5C8 AT SSLEXCHANGE DOT solomonsystech DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6334E09627481B4AA5C8DE1E69E19D3B013BA5C8@SSLEXCHANGE.solomonsystech.com> User-Agent: Mutt/1.4.1i On Thu, Jul 08, 2004 at 09:05:20AM +0800, jackylam AT solomon-systech DOT com wrote: >I want to share "1" bit between two same cygwin processes. I know I >should use cygipc or cygserver formally. But I really want to run the >system in a simple and standalone way. Is there any unused bit in >cygwin internal structure I can use to share that bit? If there was it would be a horrendously bad idea for you to use it. Since it isn't documented, it would be subject to change and then where would you be when you upgraded to a new version of cygwin? >Or any other idea is welcome. Thanks. Check the "info gcc" documentation and look for the "shared" attribute. It probably does exactly what you want. I've extracted a section from the documentation below. cgf `shared' On Microsoft Windows, in addition to putting variable definitions in a named section, the section can also be shared among all running copies of an executable or DLL. For example, this small program defines shared data by putting it in a named section `shared' and marking the section shareable: int foo __attribute__((section ("shared"), shared)) = 0; int main() { /* Read and write foo. All running copies see the same value. */ return 0; } You may only use the `shared' attribute along with `section' attribute with a fully initialized global definition because of the way linkers work. See `section' attribute for more information. The `shared' attribute is only available on Microsoft Windows. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/