🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1425

(none)

#1425
From: Gernot Skalla
Date: Tue, 17 Nov 1992 17:32
53 lines
1911 bytes
Dear Ladies and Gentlemen,

The last few days I tried to compile a program
using Light Weight Processes with 'gcc'.
We are running SunOS 4.1.2 and gcc-2.2.2 on Sparc ELCs.
Are there any known problems?
Is it a bug? In 'gcc'? In the lwp-library?

This is the program:
$ cat lwptest.c
#include <stdio.h>
#include <lwp/lwp.h>

#define MAXPRIO 10

main ( argc, argv )
int     argc;
char    **argv;
{
        int prio, max ;

        (void) pod_setmaxpri (  MAXPRIO );
        prio = lwp_setpri ( SELF, MAXPRIO );
        max  = pod_getmaxpri();
        printf ("MAXPRIO=%d priority=%d\n", max, prio);
        prio = lwp_setpri ( SELF, MAXPRIO );
        printf ("MAXPRIO=%d priority=%d\n", max, prio);
}

$ cc -o lwptest.cc lwptest.c -llwp
$ gcc -o lwptest.gcc lwptest.c -llwp
$ lwptest.cc
MAXPRIO=10 priority=10
MAXPRIO=10 priority=10
$ lwptest.gcc
MAXPRIO=10 priority=1
MAXPRIO=10 priority=10

The manual on 'pod_setmaxpri' tells me:
	"...By using pod_setmaxpri() before any other LWP
         primitives, you can ensure that main will receive the same
         priority as the argument to pod_setmaxpri()."

and on 'lwp_setpri':
	"lwp_setpri() returns the previous priority on success. On
	 failure, it returns -1."

I just cannot figure out, why I have to set the priority explicitly,
when using 'gcc'.

Any hints would be appreciated.
Sincerely
	Gernot Skalla
Technical Details
Message-ID: <9211171532.AA04368@dosuni.informatik.Uni-Osnabrueck.DE>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!garm.informatik.uni-osnabrueck.de!gskalla

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!garm.informatik.uni-osnabrueck.de!gskalla
From: gskalla@garm.informatik.uni-osnabrueck.de (Gernot Skalla)
Subject: (none)
Message-ID: <9211171532.AA04368@dosuni.informatik.Uni-Osnabrueck.DE>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 17 Nov 1992 17:32:20 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 54