From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108a70,5b8b33eabd5a00e8 X-Google-Attributes: gid108a70,public X-Google-Thread: fee84,5b8b33eabd5a00e8 X-Google-Attributes: gidfee84,public From: Don Melano Subject: Re: Urgent Problem: Sybase Threads on OSF1 Alpha Date: 1998/05/13 Message-ID: <35599B32.794B@tspi.elan.af.mil>#1/1 X-Deja-AN: 352866349 Content-Transfer-Encoding: 7bit References: <6ja0nl$eqt$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: Hughes.net Mime-Version: 1.0 Newsgroups: comp.databases.sybase,comp.unix.osf.osf1 c.eltawil@architel.com wrote: > > Hi, > We have an application that was written with Sybase threads. > After porting it to a DEC Alpha machine, there seems to be a problem, > here it is: > > 2 different threads are calling the same function > some variables declared local as automatic in that function are corrupted > (doesn't thread has a stack of its own) > > Anybody has ever experirnced this or has any insights. > > thanks in advance > > BTW: that problem does not appear on other platforms (HP, Sun, IBM). > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/ Now offering spam-free web-based newsreading According to Kernighan & Ritchie "The C Programming Language": "automatic variables come and go with function invocation, they do not retain their values from one call to the next, and must be explicity set upon each entry. If they are not set, they will contain garbage." Also note according to David Butenhof's book "Programming with POSIX Threads" that all threads within a process share the same address space and that any variable declared as "static" or "extern", or in the "process heap", may be read and written by all threads within the process. Hope this helps. -- Don Melano Computer Sciences Corp. Advanced Technology Divison Edwards Air Force Base, Flight Test Center, CA.