HDTenEightyP/NetNews huggingface dataset:
From: jolly@next3.cis.uni-muenchen.de (Patrick Stein)
Subject: another KERNEL BUG : SLOW THREADS
Keywords: kernel, threads, mach, thread, bug, operating system, os
Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
Date: Tue, 6 Oct 1992 18:36:10 GMT

/*

Hiho again from munich B)


I posted the mach kernel bug , but nobody answered B(

So if you don't believe me ... test this program under NS2.1 and NS3.0
It's unbelievable slow under 3.O. WHY ???
Didn't NeXT remove the DEBUG Messages ?????
My first thought was, that the mutex_unlock,mutex_lock and the conditon_*
functions are so slow : There are not slow, the cthread_detach(cthread_fork...
is the major speed problem. 
I need a fast thread execution time, so i will be very very very inter-
ested in hints or improvements to solve that situation.

					Jolly




post scriptum : the program can be found in the DL too ( only the number of
		threads changed )


*/

#include <stdio.h> 
#include <cthreads.h>

int         count;    /* number of slave threads active */ 
mutex_t     lock;     /* mutual exclusion for count */ 
mutex_t     print;    /* mutual exclusion for printfs */ 
condition_t done;     /* signaled each time a slave thread finishes */

void init() 
{ 
    /* Allocate mutex variables "lock" and "print". */     
    lock = mutex_alloc();    
    print = mutex_alloc(); 

    /* Allocate condition variable "done". */     
    done = condition_alloc(); 

    count = 0; 
}

/*
 * Each slave just loops, yielding the processor on each 
 * iteration.  When it's finished, it decrements the global 
 * count and signals that it's done.  
 */ 
void slave(int n) 
{ 
    int i;

    for (i = 0; i < 100; i += 1) 
        cthread_yield(); 

    /*
     * If any thread wants to access the count variable, it      
     * first locks the mutex.  When the mutex is locked, any      
     * other thread wanting the count variable must wait until      
     * the mutex is unlocked.  
     */ 
    mutex_lock(lock); 
    count -= 1; 
    mutex_lock(print);
    printf("Slave %d finished.\n", n); 
    mutex_unlock(print);
    /* Signal that this slave has finished. */ 
    condition_signal(done);    
    mutex_unlock(lock); 
}

/*
 * The master spawns a given number of slaves and then waits 
 * for them all to finish.  
 */ 
void master(int nslaves) 
{ 
    int i;

    for (i = 1; i <= nslaves; i++) { 
        mutex_lock(lock); 
        /* Increment count with the creation of each slave thread.  */ 
        count += 1; 
        /* Fork a slave and detach it.  */ 
        cthread_detach(cthread_fork((cthread_fn_t)slave, (any_t)i)); 
        mutex_unlock(lock); 
    } 

    mutex_lock(lock); 
    /*
     * Master thread loops waiting on the condition done.  Each      
     * time the master thread is signaled by a condition_signal      
     * call, it tests the count for a value of zero.  
     */ 
    while (count != 0) 
        condition_wait(done, lock); 
    mutex_unlock(lock); 

    mutex_lock(print);
    printf("All %d slaves have finished.\n", nslaves); 
    mutex_unlock(print);
    cthread_exit(0); 
}

main() 
{ 
    init(); 
    master(150);  /* Create master thread and 15 slaves. */ 
}
From: julie@next.com (Julie Zelenski)
Newsgroups: comp.sys.next.programmer
Subject: Developer Support "core dump"
Date: 29 Sep 92 19:25:06 GMT
Reply-To: julie@next.com


At a recent BANG meeting, we held a discussion about what kinds of things  
we (Developer Support) could do to help out on net, provide some presence,  
leverage the community, whatever, as a volunteer effort from our group.   
One idea we came up with is to periodically share interesting questions  
that come up and how they get solved.  Also we'd like to share reports and  
workarounds for some of the bugs you will encounter as a developer.  We  
also may try to release the "hot" NextAnswers as they are written and  
before the formal collection goes out for that quarter asked and show the  
resolution. (Eric P. Scott actually asked that they don't get labelled as  
NextAnswers until they really come out with the collection, if it matters  
to you).

If you have other suggestions of leveraged ways we can offer some help to  
our community, I would appreciate your constructive feedback 

I'm sending out our first two posts now:  one, the resolution to a  
question about shared NXImages, and the second with a few bugs you should  
be aware of.

Happy Coding!

Julie Zelenski		julie@next.com
Developer Support
Newsgroups: comp.sys.next.programmer
From: kruegewa@cda.mrs.umn.edu (Puffin)
Subject: Wanted:  simple public-domain terminal GUI
Organization: University of Minnesota - Morris
Date: Wed, 30 Sep 1992 17:49:40 GMT

I'd like to find a terminal-type interface that could sit on top of a network  
interface of my own design.  Does anyone know of such a thing laying about the  
net?  I've tried archie and manual searches of certain anon-ftp sites to no  
avail.

Any help would be greatly appreciated.

--
   W. Alan "Puffin" Krueger  |    Professional/Perpetual Friend-At-Large
  Univ of Minnesota, Morris  |              Master Of Puffins
KRUEGEWA  @  CAB.MRS.UMN.EDU |    "Don't look at me, I just live here!"
ALAN  @ NXSCI173.MRS.UMN.EDU | Listen to the U~90 Alternative!  KUMM 89.7 fm
From: fermat@fermat.dartmouth.edu (Michael Glenn)
Newsgroups: comp.sys.next.programmer
Subject: Re: gcc2.2.2
Date: 27 Sep 92 23:03:37 GMT
Organization: Dartmouth College, Hanover, NH

In article <1992Sep25.112038.1443@cs.uoregon.edu>  
bfjeld@obelix.cs.uoregon.edu (Bjorn S. Fjeld Pettersen) writes:
> Have anyone compiled gcc2.2.2 on the NeXT? I'm following the 
> instructions, and it won't go past rtl.c. I'm using 3.0.
> Any help would be greatly appreciated!
> 
> Bjorn.
> bjorn@darmok.uoregon.edu

I also had the same problem.  Right at the "make LANGUAGES=c" stage.  
(making stage 1 compiler)  Here is what I see:

cc -c    -g     -I. -I. -I./config rtl.c
rtl.c:192: illegal expression, found `__extension__'
rtl.c:192: illegal expression, found `__extension__'
rtl.c:192: illegal expression, found `int'
rtl.c:192: illegal external declaration, found `)'
rtl.c:192: illegal external declaration, found `if'
rtl.c:192: illegal method selector, found `0'
rtl.c:192: illegal method definition, missing `{' after `)'
rtl.c:192: syntax error, found `->'
rtl.c:192: illegal external declaration, missing `;' after `)'
rtl.c:192: illegal method definition, found `->'
rtl.c:192: illegal method definition, missing `{' after `)'
rtl.c:192: illegal external declaration, missing `;' after `__o1'
rtl.c:197: illegal external declaration, missing `;' after `unsigned'
rtl.c:201: illegal external declaration, found `return'
rtl.c:656: illegal expression, found `__extension__'
rtl.c:656: illegal expression, found `int'
rtl.c:656: illegal expression, found `)'
rtl.c:660: illegal expression, found `else'
rtl.c:663: illegal expression, found `__extension__'
rtl.c:663: illegal expression, found `)'
rtl.c:666: illegal expression, found `__extension__'
rtl.c:666: illegal external declaration, found `)'
rtl.c:667: illegal external declaration, missing `;' after `*'
rtl.c:667: illegal external declaration, found `if'
rtl.c:667: illegal method selector, found `0'
rtl.c:667: illegal method definition, missing `{' after `)'
rtl.c:667: syntax error, found `->'
rtl.c:667: illegal external declaration, missing `;' after `)'
rtl.c:667: illegal method definition, found `->'
rtl.c:667: illegal method definition, missing `{' after `)'
rtl.c:667: illegal external declaration, missing `;' after `__o1'
rtl.c:689: illegal method selector, found `1'
rtl.c:689: illegal method definition, missing `{' after `)'
rtl.c:690: illegal function prototype, found `('
rtl.c:690: illegal function definition, found `)'
*** Exit 1

I got my gcc-2.2.2 from aeneas.mit.edu, and am running 3.0 which I built  
straight from cd-rom to a clean disk.  (I configured with "configure  
--target=next-mach3.0")  Any hints?

fermat@fermat.dartmouth.edu (NeXTmail welcome)
From: chase@stumpy.cs.orst.edu (A. Chase Turner)
Newsgroups: comp.sys.next.programmer
Subject: Request for examples of NILoginPanel
Keywords: NILoginPanel
Date: 6 Oct 92 16:22:16 GMT
Article-I.D.: CS.1992Oct06.162216.15706
Reply-To: Chase_Turner@stumpy.cs.orst.edu
Organization: Oregon State University, Computer Science Dept

I am having difficulties using NILoginPanel in NeXT OS 3.0.  Neither the  
 
3.0 Documentation nor NeXTAnswers AQ697 clarify the ambiguity about the nature of call backs to the delegate after a validation has been performed. A similar question was posted to comp.sys.next.programmer by clu@malihh.hanse.de (Carsten Lutz) in March 1992: no one has posted a solution 
 
 in response to his question yet...

In the code fragment below, 
runModalWithValidation:InDomain:withUser:withInstruction:allowChange
always returns FALSE even though I have established a connection with a netinfo domain.  IsValidLogin: always returns TRUE if I use either runModal:*** or runModalWithValidation:*** with an INVALID password.

I have supplied a code fragment below.  Comments or other code fragments with NILoginPanel are welcome...

chase_turner@stumpy.cs.orst.edu

======================================================================
- (BOOL) loadKernel
{
	id	authorizationPanel = [NILoginPanel new];
	id	domainPanel	= [NIDomainPanel new];
	id	aDomain = [NIDomain alloc];

	//status indicators
	unsigned niResult;
	BOOL	loginValidP = FALSE;
	BOOL	verificationP = FALSE;
		
	[domainPanel runModal];
	[aDomain init];

	// This is to ensure I am passing a legitimate domain connection to the NILoginPanel instance
	niResult = [aDomain setConnection: [domainPanel domain]];

	assert (niResult == NI_OK);

	// the following ALWAYS returns FALSE
	loginValidP = [authorizationPanel runModalWithValidation:self
				inDo 
main:[aDomain getDomainHandle]
				withUser:"root"
				withInstruction:"A relocatable kernel needs to be loaded.  Please issue the root password in order to continue."
				allowChange:FALSE];

	// the following ALWAYS returns TRUE even with incorrect passwords
	verificationP = [authorizationPanel isValidLogin: self];

	[aDomain disconnectFromCurrent];
	[aDomain free];

	if (loginValidP == TRUE) {
	.....(etc)
ents with NILoginPanel are welcome...

chase_turner@stumpy.cs.orst.edu

======================================================================
- (BOOL) loadKernel
{
	id	authorizationPanel = [NILoginPanel new];
	id	domainPanel	= [NIDomainPanel new];
	id	aDomain = [NIDomain alloc];

	//status indicators
	unsigned niResult;
	BOOL	loginValidP = FALSE;
	BOOL	verificationP = FALSE;
		
	[domainPanel runModal];
	[aDomain init];

	// This is to ensure I am passing a legitimate domain connection to the NILoginPanel instance
	niResult = [aDomain setConnection: [domainPanel domain]];

	assert (niResult == NI_OK);

	// the following ALWAYS returns FALSE
	loginValidP = [authorizationPanel runModalWithValidation:self
				inDo
Newsgroups: comp.sys.next.programmer
From: timm@xongmao.ncsa.uiuc.edu (Tim McClarren)
Subject: NXBrowser problem...
Organization: University of Illinois at Urbana
Date: Wed, 30 Sep 1992 03:30:27 GMT


I am experiencing a problem with the NXBrowser class under
3.0.  In effect, the manual page says to use the method "setCellClass:" to
set the class of the cells that the Browser is to create inside the
new columns it makes.  I then use the "addRow" method of class Matrix
and it seems that the new cells are in fact NOT of the class I had
specified.  I am subclassing NXBrowserCell, so that isn't the problem
I don't think.  How do I get NXBrowser to behave properly without going
around it's back and setting the cell prototype in the Matrix like the
documentation specifically warns against doing?

Tim

-- 
Tim McClarren     | "...a bajillion brilliant Jobsian lithium licks."
timm@ncsa.uiuc.edu|
(217)244-0015     |
From: haker@whitewater.chem.wisc.edu (Michael  Haker)
Newsgroups: comp.sys.next.programmer
Subject: mouseMoved events?
Date: 30 Sep 92 01:20:24 GMT
Organization: Physical Sciences Lab, UW-Madison

Hi
I'm trying to get my app to generate mouseMoved events while the mouse is  
in a particular view (bordered by mouseEntered and mouseExited events).   
The documentation describes what needed to generate the enter/exit events  
and that's working fine, but no mouseMoved events.  I am assuming that a  
mouseMoved event is generated anytime a mouse is moved when neither mouse  
button is pressed.  Here is the essence of the code that is in a view  
subclass :

- mouseMoved:(NXEvent *)e
{ /* important stuff */
   return self;
}
- mouseEntered:(NXEvent *)e
{
   moveMask = [window addToEventMask:NX_MOUSEMOVEDMASK];
   /* setup */   
   return self;
}
- mouseExited:(NXEvent *)e
{
   [window setEventMask:moveMask];
   /* setdown */
   return self;
}

any help would be greatly appreciated.  Please e-mail responses.

Mike Haker
haker@whitewater.chem.wisc.edu
From: johann@nevada.edu (JASON CATHCART)
Subject: Help installing rn
Originator: johann@helios.nevada.edu
Organization: University of Nevada System, Computing Services
Distribution: na
Date: Mon, 5 Oct 1992 20:39:26 GMT

I am having trouble making rn..don't know if it's the 3.0 or just me :)

Though rn is VERY straight forward to install, I couldn't figure out
the proper CFLAGS to use. 
I am on an 040 Cube under 3.0.
I am compiling with only:	cc -c -bsd -O file.c
I can't find what flags to use to allow use of multiple symbols with
same names.  
It makes all the obj files, but fails when it attempts to put them
together into rn with the following:
-------------
cc   addng.o art.o artio.o artsrch.o backpage.o bits.o cheat.o final.o head.o help.o init.o intrp.o kfile.o last.o ndir.o ng.o ngdata.o ngsrch.o ngstuff.o only.o rcln.o rcstuff.o respond.o rn.o search.o sw.o term.o util.o  -ltermlib -lsys_s  -o rn
/bin/ld: multiple definitions of symbol _readdir
ndir.o definition of _readdir in section (__TEXT,__text)
/lib/libsys_s.a(readdir.o) definition of absolute _readdir (value 0x5002d68)
/bin/ld: multiple definitions of symbol _closedir
ndir.o definition of _closedir in section (__TEXT,__text)
/lib/libsys_s.a(closedir.o) definition of absolute _closedir (value 0x50022a0)
/bin/ld: multiple definitions of symbol _opendir
ndir.o definition of _opendir in section (__TEXT,__text)
/lib/libsys_s.a(opendir.o) definition of absolute _opendir (value 0x5002bca)
*** Exit 1
Stop.
-------------
An executable rn is created (205516 bytes) but I get a bus error when I try
to run it.

Has anyone successfully made rn under 3.0?
What should I do?

Thanks for your time.
Jason Cathcart
johann@bach.nevada.edu
From: jgg@proforma.com (J. G. Gregory)
Subject: Help with N3DCamera orientation
Keywords: 3Dkit
Organization: Pro Forma
Date: Sat, 26 Sep 1992 16:28:03 GMT

I have some questions about specifying the orientation of N3DCamera.  Any help  
would be greatly appreciated.

Question 1:

How do I reliably set the roll angle of an N3DCamera?

I have been unable to get an isometric view without kludges.  I'm trying to use  
this simple method:

- isoView
{
   RtPoint eye = {1,-1,1}; // Really scaled for size of world
   RtPoint view = {0,0,0};

   [self setEyeAt:eye toward:view roll:0];
 
   return self;
}

This aligns the T axis (camera vertical) with the world's Y axis.  I need it  
aligned with the world's Z axis. 

If you think about it, the whole concept of setEyeAt:toward:roll: is broken.   
How can it know what orientation the Camera starts at?  You have to have some  
kind of start orientation for any kind of angle to make sense.  I would be  
surprised if any can use it effectively.  But maybe I am missing something.

Question 2:

How do I set up a right-handed coordinate system?  I have written about this  
before, but still haven't got it right.  What I really want to do is set up a  
right-handed system BEFORE either the camera or world transforms are set, such  
that everything is right-handed.  But 3Dkit doesn't let you do the same things  
as general RenderMan procedural calls, since you can't seem to get in before  
the camera is up.

I have tried lots of different approaches.  The code below yields the correct  
orientation of the axes, but gives the following message in the Console  
whenever something is rendered, or whenever I ask for selectedShapesIn:.

Warning in context 708DF in command ?:  OutOfRange:
        Anisometric world-to-camera transformation.
Shading may be incorrect.

Code from [MyCamera initFrame:]

  RtMatrix orient = {{-1, 0, 0, 0},
		     { 0, 1, 0, 0},
		     { 0, 0, 1, 0},
		     { 0, 0, 0, 1}};

  [super initFrame:theRect];
  [self setPreTransformMatrix:orient];
  [self setUsePreTransformMatrix:YES];

and code from [MyCamera worldBegin:]

   RiScale(1.0, 1.0, -1.0);
   return [super worldBegin:theContext];

Thanks in advance, 
--J Gregory
Newsgroups: comp.sys.next.programmer
From: michael@stb.info.com (Michael Gersten)
Subject: Re: How do I set the tab spacing in Edit?
Organization: STB BBS, La, Ca, 310 397 3137
Date: Mon, 28 Sep 1992 18:42:35 GMT

Ok, here's another question on Edit and tab spacing:

Is it possible to tell Edit that I want a tab for 8 blank spaces, but pressing
the tab key only goes 4 spaces?

In other words, when I hit <tab> once, I get an indent of 4 spaces, but if I
press it twice, I get a real ^I TAB in the file?

		Michael
-- 
		Michael Gersten		michael@stb.info.com
HELLO! I'm a signature virus! Join in the fun and copy me into yours!
ex:.-1,. w $HOME/.signature
Newsgroups: comp.sys.next.programmer
From: BrianW@SoundS.WA.com (Brian Willoughby)
Subject: Re: NXBrowser problem...
Reply-To: BrianW@SoundS.WA.com
Organization: SoundSoftware, Bellevue, WA, USA
Date: Mon, 5 Oct 1992 01:15:11 GMT

Tim McClarren writes
| I am experiencing a problem with the NXBrowser class under
| 3.0.  In effect, the manual page says to use the method "setCellClass:" to
| set the class of the cells that the Browser is to create inside the
| new columns it makes.  I then use the "addRow" method of class Matrix
| and it seems that the new cells are in fact NOT of the class I had
| specified.  I am subclassing NXBrowserCell, so that isn't the problem
| I don't think.  How do I get NXBrowser to behave properly without going
| around it's back and setting the cell prototype in the Matrix like the
| documentation specifically warns against doing?

I posted the answer to this on Sep 14, but it was perhaps obscured among some  
other answers - here is a short recap:

After MUCH experimentation under 2.1, I found that -appDidInit: and  
-setBrowserOutlet: were not reliable places to make the -setCellClass: call.  I  
subclassed NXBrowser and included the following class method:

+ initialize
{
	[super initialize];
	[NXBrowserSub setCellClass:[NXBrowserTextFieldCell class]]; // bogus?
	[self setCellClass:[NXBrowserTextFieldCell class]];
	return self;
}

This code looks redundant, but that is because I never went back to look at it  
until today.  I guess the old adage: "don't fix it if it ain't broke" applies  
here.  I would assume that either line would suffice, but I haven't tested  
anything but what appears above.

#mount _soap_box
This is a prime example of how NeXTanswers is nearly useless.  appkit.827 says  
to -setCellClass inside -initFrame:, appkit.816 says to -setCellClass in  
-appDidInit:, appkit.761 says that you must -setCellClass in +initialize  
because -init is too late, implying that -appDidInit would be far too late.  It  
took a great deal of experimentation and searching to figure out what worked.   
Of course the simpler approaches didn't work and they were what I tried first.
#dismount _soap_box
-- 
Brian Willoughby	Software Design Engineer, BSEE NCSU
BrianW@SoundS.WA.com	Sound Signal Processing Software and Consulting
NeXTmail welcome	- NO EMAIL SOLICITATION without prior permission
From: gordie@duts.ccc.amdahl.com (Gordie Freedman)
Newsgroups: comp.sys.next.programmer
Subject: Re: emacs in Terminal in 3.0
Date: 30 Sep 92 02:40:36 GMT
Reply-To: gordie@duts.ccc.amdahl.com
Organization: Happy hacker bait and tackle shop

In article 9254@pasteur.Berkeley.EDU, pkim@cory.Berkeley.EDU (-) writes:
>does anyone know how to make the alternate key work as a meta key in emacs
>running under Terminal (release 3.0).  it used to work under 2.x.
>thanks in advance,
>paul kim
>mtcoak!paul@netcom.com
>pkim@cory.berkeley.edu


You have to go to terminal preferences and set the option for alternate key behavior. Either the default changed, or 3.0 changes it back. I have to go home and look up the exact option, but you can probably intuit it. I think it is under VT100 options, or something like that, and there are two choices dealing specifically with the alternate ky. Change it to the one not selected, than apply it to any open terminal windows, and set it as the default. (This preference panel also has options for VT100 stuff).





---
Gordie Freedman: gordie@kaleida.com Sigs are for kids


Newsgroups: comp.sys.next.programmer
From: tom@ennex1.eng.utsa.edu (Tom Arnow)
Subject: Re: Help! Help! Palette Problem
Reply-To: tom@ennex1.eng.utsa.edu (Tom Arnow)
Organization: Univ of Texas at San Antonio
Date: Mon, 28 Sep 1992 19:49:24 GMT

In article <80490@ut-emx.uucp> tarnow@onyx.cc.utexas.edu (Thomas Arnow)  
writes:
> I had a custom palette under 2.0 
> Now that we have switched to release 3
> InterfaceBuilder cannot read read the old palette. I have tried
> to rebuild it under 3.0. Build was successful but IB still will not
> read it. 
> I could remove the palette - it is a Circular Slider and
> could be replaced with an ordinary slider.
> I cannot even load the nib to remove the palette!
> 
> Any help would be greatly appreciated
> 
> Tom Arnow

I got around the problem by loading version 2.1 IB from Optical, removing  
the palette and resaving the nib. Lucky the project can do without it.
Please note that the original article had a bad return address. This has a  
correct one.
THanks
Tom
Newsgroups: comp.sys.next.programmer
From: greg@afs.com (Gregory H. Anderson)
Subject: Re: Code to show all methods an object responds to.
Reply-To: greg@afs.com
Date: Tue, 29 Sep 1992 15:51:25 GMT

In article <1992Sep26.033132.245@nugget.rmNUG.ORG> timothy@eddie.rmNUG.org  
writes:
> I saw some code in a post a little while back that would list all the  
> methods an object would respond to. I've searched and searched to no  
> avail. Could someone point me in the right direction or send me the  
> post.

Here is a small code sample to list the names and arguments of all methods  
an object can respond to. Note that method_name is a selector, which is  
then mapped to the ASCII name with sel_getName. method_types has a complex  
encoding mechanism that includes the return value type, followed by a list  
of argument coding characters and distances from the stack pointer. It's  
better to use the runtime method_xxx() calls to get this information.
 
============================ clip 'n' save =========================

- printMethodListFor:sender
  {
  Class classInfo = [sender class];
  int i;

  while (classInfo)
    {
    if (classInfo->methods != NULL) 
      {
      for (i = 0; i < classInfo->methods->method_count; i++)
        printf("%s %s\n", 
          sel_getName(classInfo->methods->method_list[i].method_name),
          classInfo->methods->method_list[i].method_types);
       }
      classInfo = classInfo->super_class;
    }
    return self;
  }

============================ clip 'n' save =========================

--
Gregory H. Anderson          | "We're very tolerant around here,
Benevolent Dictator-for-Life |  being only amateurs ourselves."
Anderson Financial Systems   | - Tortoise (Godel, Escher, Bach)
greg@afs.com  (Nextmail OK)  |