home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2789 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.8 KB  |  67 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: 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
  3. From: gskalla@garm.informatik.uni-osnabrueck.de (Gernot Skalla)
  4. Subject: (none)
  5. Message-ID: <9211171532.AA04368@dosuni.informatik.Uni-Osnabrueck.DE>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 17 Nov 1992 17:32:20 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 54
  12.  
  13. Dear Ladies and Gentlemen,
  14.  
  15. The last few days I tried to compile a program
  16. using Light Weight Processes with 'gcc'.
  17. We are running SunOS 4.1.2 and gcc-2.2.2 on Sparc ELCs.
  18. Are there any known problems?
  19. Is it a bug? In 'gcc'? In the lwp-library?
  20.  
  21. This is the program:
  22. $ cat lwptest.c
  23. #include <stdio.h>
  24. #include <lwp/lwp.h>
  25.  
  26. #define MAXPRIO 10
  27.  
  28. main ( argc, argv )
  29. int     argc;
  30. char    **argv;
  31. {
  32.         int prio, max ;
  33.  
  34.         (void) pod_setmaxpri (  MAXPRIO );
  35.         prio = lwp_setpri ( SELF, MAXPRIO );
  36.         max  = pod_getmaxpri();
  37.         printf ("MAXPRIO=%d priority=%d\n", max, prio);
  38.         prio = lwp_setpri ( SELF, MAXPRIO );
  39.         printf ("MAXPRIO=%d priority=%d\n", max, prio);
  40. }
  41.  
  42. $ cc -o lwptest.cc lwptest.c -llwp
  43. $ gcc -o lwptest.gcc lwptest.c -llwp
  44. $ lwptest.cc
  45. MAXPRIO=10 priority=10
  46. MAXPRIO=10 priority=10
  47. $ lwptest.gcc
  48. MAXPRIO=10 priority=1
  49. MAXPRIO=10 priority=10
  50.  
  51. The manual on 'pod_setmaxpri' tells me:
  52.     "...By using pod_setmaxpri() before any other LWP
  53.          primitives, you can ensure that main will receive the same
  54.          priority as the argument to pod_setmaxpri()."
  55.  
  56. and on 'lwp_setpri':
  57.     "lwp_setpri() returns the previous priority on success. On
  58.      failure, it returns -1."
  59.  
  60. I just cannot figure out, why I have to set the priority explicitly,
  61. when using 'gcc'.
  62.  
  63. Any hints would be appreciated.
  64. Sincerely
  65.     Gernot Skalla
  66.  
  67.