delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/07/22:14:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <cgf-no-personal-reply-please AT cygwin DOT com>
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
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019