🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Gernot Skalla Tue, 17 Nov 1992 17:32
(none)
#1425
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads