Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c Subject: Re: Typecasting Pointers on a 64 bit System Date: Tue, 15 Nov 2011 10:15:06 +1300 Lines: 29 Message-ID: <9idemqFhikU1@mid.individual.net> References: <9i314pF5h8U10@mid.individual.net> <9id8f7FhijU1@mid.individual.net> <4EC1709A.3040400@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net GcRKVS0b3AiLlW0fc2uMPw0aLY32HmGpHSYfWwQPd7hJsO+fqJ Cancel-Lock: sha1:1/XdwbpWL5W5aufTBu6VJF0oGC4= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2 In-Reply-To: <4EC1709A.3040400@verizon.net> Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:13317 On 11/15/11 08:48 AM, James Kuyper wrote: > On 11/14/2011 02:28 PM, Ian Collins wrote: >> On 11/15/11 08:10 AM, William Ahern wrote: > .... >>> Pass-by-reference and threads aren't >>> known to play well. IMHO the OP had sensible intuition to pass the >>> descriptor by value. It may not be pretty in C, but neither is threaded >>> programming. >> >> As long as the address is still valid when a thread dereferences it, >> what's the problem? > > The possibility that the address might NOT still be valid at the time of > use. This has already been pointed out, and is explicitly considered > (but somehow ignored as unimportant) in your own response. I had assumed a competent programmer would be aware of the issue. I had further assumed a programmer writing threaded applications to be competent. If either of those assumptions are untrue, the programmer's foray into threaded programming will be brief and painful. > A relevant response would give reasons justifying your treatment of that > possibility as unimportant. Where did I say it was unimportant? Do you expect me to qualify every mention of passing an address? -- Ian Collins