Ajay Bansal | 1 Apr 06:50 2003

Different behaviour of program

Hi All

Following program behaves differently on Solaris and Linux if we pass
SIGTERM (kill -15) or ^C (kill -2) to running program. I am using Sun
Workshop compiler on Solaris and gcc on Linux.

But I am not able to understand why!!!!!!!!!!!!!!!!!

TIA
Ajay
-------------------------------------------------------

/* This program illustrates pthread_kill( ). It can be used to send any
signal 
to any thread from any other thread.If not caught, it will cause that
thread as well 
as whole process to terminate. */ 

#include<iostream.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#define NTHREADS 4

pthread_t worker[NTHREADS];
pthread_t pid;	

void smServerSignalHandler(int sig_num) {
(Continue reading)

Glen Kim | 1 Apr 10:39 2003
Picon

problems building arm cross-compiler

Hi,
	I'm trying to build a gcc 3.2.2 cross-compiler for the ARM
architecture.  I am running gentoo linux, and using gcc-3.2.2.  As far as
I can tell, buiding halts when looking for the included file pthread.h in
gcc/gthr-posix.h, in gcc/unwind-dw2.c.  I apologize if this information is
available elsewhere, but so far my own search attempts have turned up
nothing.  Thanks for your time.

Glen.

Christian Schaefer | 1 Apr 12:58 2003
Picon

seeking networking and pthreads advice

hi there,

I want to write a networking module which communicates with specially
prepared messages over tcp/ip sockets.
thats no problem.
those messages belong to different dialogs. meaning: every dialog is a
sequence of client and server messages.
but since there can be several dialogs active, I had following idea:

I want to have a queue of pthreads. one for each open dialog. and a
message-engine, that gives the identifier of the current message to each
thread until one answers "that message is mine".

I would know how to do this, but since the message handling requires a
lot of data from the application I wondered how to give the thread
access to that data.

what I did is this:
I build a rather complicated struct with all general data in it.
and as a argument to the pthread I gave a pointer to that struct.
is this ok, or should i use global variables or is there a much better
way that I can not think of right now?

thanks in advance
/christian

Simon MORLAT | 1 Apr 17:26 2003
Picon

removal of unreferenced static variables

Hello all,

Is there an option to prevent gcc to skip out of a program unreferenced
static objects ?
I've looked at the manual but found nothing that worked.

Here is my practical example (stupid here, but simplified from a real
case):
in object1.h
class Object1
{
	public:
		Object1(){
			std::cout<<"Object 1 is living"<<endl;
		}
}

in object2.h:
#include "object1.h"
class Object2
{
	public:
		void fantasticFunction(){
			cout<<"does nothing interesting.";
		}
	private:
		static Object1 _myobject1;
}
in object2.cc
#include "object2.h"
(Continue reading)

LLeweLLyn Reese | 1 Apr 18:17 2003

Re: gcc 3.2.2 error message

Philip Cheng <cheng <at> pcigeomatics.com> writes:

> Dear List:
> 
> I just updated to use gcc 3.2.2. and Red 8.0 to build a share library.
> It came back with the message 
> 
> undefined versioned symbol name 
> _ZNSs15_M_replace_safeIPKcEERSsN9__gnu_cxx17__normal_iteratorIPcSsEES6_T_S7_ <at>  <at> GLIBCPP_3.2
> ld: failed to set dynamic section sizes: Bad value

Please post a short (but complete) example program which reproduces the problem.

> 
> I could build it successfully with gcc 3.1 and Red Hat 7.2.
> Is this a GCC bug?

Without example code which reproduces the problem, no-one can tell.

drkm | 2 Apr 02:26 2003
Picon

How to use the tree interface ?

  Hi.

  After searching infos on using the tree interface, in GCC Internals
Info file, GCC web pages, GCC mailing lists archives, etc., I don't
found what I looked for.

  I would like to use the infos in the Tree representation, in a tool
separated from the compiler.  What is the right way to do this ?  Scan
the dump of Trees (make my own parser of that format), use directly the
GCC tree.h interface ?  In the last case, how can I compile and like my
program (which object files from GCC are needed, and how do I must
compile then) ?

  Thanks for help.

  Regards,

--drkm

___________________________________________________________
Do You Yahoo!? -- Une adresse  <at> yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

LLeweLLyn Reese | 2 Apr 02:28 2003

Re: problems building arm cross-compiler

Glen Kim <ogle <at> OCF.Berkeley.EDU> writes:

> Hi,
> 	I'm trying to build a gcc 3.2.2 cross-compiler for the ARM
> architecture.  I am running gentoo linux, and using gcc-3.2.2.  As far as
> I can tell, buiding halts when looking for the included file pthread.h in
> gcc/gthr-posix.h, in gcc/unwind-dw2.c.  I apologize if this information is
> available elsewhere, but so far my own search attempts have turned up
> nothing.  Thanks for your time.
[snip]

Two guesses:

(a) obtain the proper pthread.h header for your target platform.
(b) configure with --disable-threads .

Segher Boessenkool | 1 Apr 21:59 2003
Picon

Re: gcc

Matthieu Moy wrote:
> If the program ends properly, I  think the output *has* to be flushed,

Yes.  If main() returns or exit() is called, all open streams are
closed; if an open stream is closed, it is flushed.

> That's why its generally  a good advice to put "\n" at  the end of any
> debug/test output. 

Note that (on typical Unix-like systems) only stderr is line buffered
by default; stdout is block buffered.  This means that a '\n' char
is not enough to flush stdout; either explicitly call fflush() or
use setbuf() or setvbuf().

Segher

LLeweLLyn Reese | 2 Apr 07:53 2003

Re: seeking networking and pthreads advice

Christian Schaefer <caefer <at> krachstoff.net> writes:

> hi there,
> 
> I want to write a networking module which communicates with specially
> prepared messages over tcp/ip sockets.

This doesn't sound like gcc question. This is a design question, or a
    threads question. I suggest you try a more appropriate forum -
    comp.programming.threads, for example.

> thats no problem.
> those messages belong to different dialogs. meaning: every dialog is a
> sequence of client and server messages.
> but since there can be several dialogs active, I had following idea:
> 
> I want to have a queue of pthreads. one for each open dialog. and a
> message-engine, that gives the identifier of the current message to each
> thread until one answers "that message is mine".
> 
> I would know how to do this, but since the message handling requires a
> lot of data from the application I wondered how to give the thread
> access to that data.
> 
> what I did is this:
> I build a rather complicated struct with all general data in it.
> and as a argument to the pthread I gave a pointer to that struct.
> is this ok, or should i use global variables or is there a much better
> way that I can not think of right now?
> 
(Continue reading)

Christian Schäfer | 2 Apr 09:07 2003
Picon

Re[2]: seeking networking and pthreads advice

hi LLeweLLyn,

> This doesn't sound like gcc question. This is a design question, or a
>     threads question. I suggest you try a more appropriate forum -
>     comp.programming.threads, for example.

you're probably right. but I am not a news/forum reader and strongly
prefere mailing lists. maybe you have an advice for a good programming
ml since I couldn't find a good one since month..

 
regards
/Christian                   mailto:caefer <at> krachstoff.net

---

I propose that the following character sequence for joke markers:

:-)

                             19-Sep-82 11:44    Scott E  Fahlman


Gmane