Re: [techtalk] Intro (Q's on m68k, beowulf, SMP programming, and databases)

1999-10-22 Thread Serena Del Bianco

On Fri, 22 Oct 1999, TeknoDragon wrote:

> Greetings,
> 
> My wife (guess who!) seems to enjoy this list a lot so I thought I'd join
> up (I seem to be doing this frequently). I'm Karl (aka Andross/TeknoDragon
> depending on the medium of participation) a CS undergrad at WSU and a
> "technopagan".
> 
> Right now I'm trying to squeeze MacOS down into 1024k or so so that I can
> install m68k on a 4MB SE/30. I think i'm close, but every combination of
> enabled and disabled extensions seems to result in memory usage, perhaps
> I'll just go find some more ram.
> 
> I'm working on a database library idea and started investigated record
> locking. I've got a system designed that's much lower level than
> semiphores (which I'd need one for every record or a semaphored record
> locking queue if I did it that way!) and hinges on the "testset" function
> that my unix programming prof told me about. The only problem is that
> testset doesn't seem to be in any manual or piece of documentation that I
> can easily find. I'm thinking something like this: (which I might be able
> to use as long as it's an attomic function and I'm not using SMP)
> 
> char testset(char *x){
>   if(*x == 0) x++;
>   else return x;
>   return 0;
> }

that wont work if you're using threads either
imagine that thread 1 tries to execute that code and x is 0
it will execute (*x == 0) and it will see the expression is true and will
execute x++ then, thread 1 is preempted and thread 2 starts executing
this time x is 1, coz thread 1 incremented it
so instead of running x++, it will return x
that's what normally should happen
but if you're unlucky and thread 2 starts executing right after (*x == 0)
executed and before x++ x will still be 0
so it will test the expression, will see it's true and will do x++
then thread 1 resumes execution and finishes doing x++
In this case the value of x will be 2 instead of 1, like in the other case
And that's evil


Serena Del Bianco



[EMAIL PROTECTED]   http://www.linuxchix.org



Re: [techtalk] SMP/threaded programming

1999-10-22 Thread Serena Del Bianco


On Fri, 22 Oct 1999, TeknoDragon wrote:

> On Wed, 20 Oct 1999, Serena Del Bianco wrote:
> 
> yes, I understand SMP programming concepts...
> 
> as I said, I was assuming I could garuntee testset was an *atomic*
> function... i.e. indivisible and possibly smaller than the timeslice of a
> scheduler... like a few i/o functions... (don't care to look them up now)
> 
> I'd probably have to look over the SMP kernel source and see what they use
> for semaphores...
> 

Have a look at spinlock.h

"lock ; btsl $0,%0\n\t" 

dunno if that's what you're looking for...


Serena



[EMAIL PROTECTED]   http://www.linuxchix.org



Re: [techtalk] ISA Ethernet card under RHat 6

1999-10-23 Thread Serena Del Bianco


On Sat, 23 Oct 1999, Walt wrote:
 
> My question is: How do I find out stuff like the IRQ
> and I/O address information for the card from the
> system?

cat /proc/ioports
cat /proc/interrupts





[EMAIL PROTECTED]   http://www.linuxchix.org