Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 59979 invoked from network); 15 Sep 2007 03:35:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2007 03:35:32 -0000 Received: (qmail 6915 invoked by uid 500); 15 Sep 2007 03:35:24 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 6890 invoked by uid 500); 15 Sep 2007 03:35:23 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 6881 invoked by uid 99); 15 Sep 2007 03:35:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Sep 2007 20:35:23 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of liyilei1979@gmail.com designates 209.85.128.191 as permitted sender) Received: from [209.85.128.191] (HELO fk-out-0910.google.com) (209.85.128.191) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2007 03:35:22 +0000 Received: by fk-out-0910.google.com with SMTP id 18so874309fks for ; Fri, 14 Sep 2007 20:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=DW8JGQIvLaC+P7cfysuptHhNFcCwoSJqYEzBWRzNXC0=; b=S+5p8WuyN5+CzpI2Oyn5qIyYvKmVRe5LuBk/yX+se4VII7dXhSRXzazqjRIWSUfKmQ0OIzBCh5aokzZE2NM8NUJwcbFMd5pxX9u+iNIPvbb3f+BEA3cY5g4/d4rrAgsCQC5aQVJGjdQYIPfHTlPifOQDPxoobnja1E6v53f+LBg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=opzZ4nOGywoZPUBCWrBoklBAWZD4Ck5TXPprcgUcA/wXUiszz2efCDB8k094FBzn6KNf0kEmMffz5jrngFqVDx/Ob1hZoIty9rLOIYJVBRHQSfJx71wJFvN6F5yrSb/2rWMgSSDbCHaT+83rwbT25oByHIZVKBoNRKlQLCoDkiM= Received: by 10.82.114.3 with SMTP id m3mr3205534buc.1189827300267; Fri, 14 Sep 2007 20:35:00 -0700 (PDT) Received: by 10.82.159.3 with HTTP; Fri, 14 Sep 2007 20:35:00 -0700 (PDT) Message-ID: Date: Sat, 15 Sep 2007 11:35:00 +0800 From: "Leo Li" To: dev@harmony.apache.org Subject: Re: [classlib] Shared Memory In-Reply-To: <46EADA63.9060300@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46EADA63.9060300@qnx.com> X-Virus-Checked: Checked by ClamAV on apache.org On 9/15/07, Rodney Dowdall wrote: > Hello > > Please forgive my ignorance, but I am not certain on how the Unix > shmget, shmat, shmdt functions work. I am trying to port the classlib > to QNX Neutrino, which uses shm_open, shm_ctl and shm_unlink. In the > shared memory code a control file is created, and then a key is > generated using ftok with the control file name. Control file data is > then written to the control file. When you do a shmat is the shared Hi, Rodney: Excuse me, are you trying to use a shared memory file as the control file? > memory attaching to the file? Or is it a clean area in memory? I'm If you transfer a NULL parameter as the target address for shmat, System will choose a proper block( and not allocated ) of virtual memory space into which the shared memory will be mapped. > wondering if I have to generate a new name for my shm_open call, or if I > can just use the control file name. If you want shm_open to get different shared memory objects, it is necessary to use distinct names. Although shm_open will return different fid by the same name, the fid will reference the same shared memory objects. Furthermore, the shared object is system wide and will last till next boot or explicitly call shm_unlink if I have not missed something. > > Thanks, > Rodney > -- Leo Li China Software Development Lab, IBM