POV-Ray : Newsgroups : povray.off-topic : BPM Server Time
4 Sep 2024 13:17:15 EDT (-0400)
  BPM (Message 51 to 60 of 77)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Darren New
Subject: Re: New BPM
Date: 9 Jun 2010 12:03:32
Message: <4c0fbb54$1@news.povray.org>
Invisible wrote:
> problem is scheduling a thread to run when I actually want it to run.

So you want to schedule real-time threads on a timesharing OS.

Have you bumped the priority of your own process up? Have you scheduled it 
to wake a few miliseconds early then busy-loop on the actual hardware clock 
until the tick comes? Have you turned off other things that might be 
generating interrupts like disk reads?

-- 
Darren New, San Diego CA, USA (PST)
    Eiffel - The language that lets you specify exactly
    that the code does what you think it does, even if
    it doesn't do what you wanted.


Post a reply to this message

From: Mike Raiford
Subject: Re: Microcode
Date: 9 Jun 2010 13:19:48
Message: <4c0fcd34$1@news.povray.org>
On 6/9/2010 9:39 AM, Invisible wrote:

> Note also that the 6502 doesn't have any microcode. It just uses a PLA
> as the control matrix - much like the processor that I'm designing. ;-)

How many instructions are you going to have? Or are you using an IC? You 
still have to map the control signals to the op code ;) That's the part 
that was giving me fits to debug (though, I'm holding off while I work 
on my simulator program, for a while ...)

-- 
~Mike


Post a reply to this message

From: Darren New
Subject: Re: Microcode
Date: 9 Jun 2010 14:10:53
Message: <4c0fd92d$1@news.povray.org>
Invisible wrote:
> Note also that the 6502 doesn't have any microcode. 

Given how the instruction sets decoded, I'm not sure it's really valid to 
say it had no microcode. There were definitely cycles of stepping thru the 
code and branching around in the PLA data.  I'm not an expert, but it wasn't 
really hard-wired logic as such. The HCF instruction, for example, was an 
emergent property of the "microcode" interpretation and not something 
necessarily intentional.

-- 
Darren New, San Diego CA, USA (PST)
    Eiffel - The language that lets you specify exactly
    that the code does what you think it does, even if
    it doesn't do what you wanted.


Post a reply to this message

From: scott
Subject: Re: New BPM
Date: 10 Jun 2010 03:14:26
Message: <4c1090d2$1@news.povray.org>
> "Retrieves the current value of the high-resolution performance counter."
>
> From what little documentation there is, it seems this allows me to 
> measure wall-time, really accurately. Which isn't the problem - the 
> problem is scheduling a thread to run when I actually want it to run.

Well just start it at roughly the right time and have the thread loop until 
it's exactly the correct time.


Post a reply to this message

From: Invisible
Subject: Re: Microcode
Date: 10 Jun 2010 04:12:13
Message: <4c109e5d$1@news.povray.org>
Darren New wrote:
> Invisible wrote:
>> Note also that the 6502 doesn't have any microcode. 
> 
> Given how the instruction sets decoded, I'm not sure it's really valid 
> to say it had no microcode.

And you actually know how it was wired up internally, do you?


Post a reply to this message

From: Invisible
Subject: Re: New BPM
Date: 10 Jun 2010 04:17:23
Message: <4c109f93$1@news.povray.org>
>> problem is scheduling a thread to run when I actually want it to run.
> 
> So you want to schedule real-time threads on a timesharing OS.
> 
> Have you bumped the priority of your own process up? Have you scheduled 
> it to wake a few miliseconds early then busy-loop on the actual hardware 
> clock until the tick comes? Have you turned off other things that might 
> be generating interrupts like disk reads?

My measurements indicate that the interval between ticks is rock solidly 
constant - it's just the *wrong* interval. (It's too large.)

I believe the problem is that the library won't let me specify an 
absolute time, only relative times. So if I was "wait 100 ms", but the 
other processing that the program does takes 1 ms, the delay ends up 
being 101 ms, not 100 ms. The fact that taking stuff out of the main 
loop made the timings nearer to what they should be supports this 
hypothesis. (Although it's always possible that the problem is related 
to the size of the quantum that Haskell's thread scheduler is using or 
something daft like that.)

Still, since no other API is available, there's not much I can do about 
it. (Other than whinge at the developers and see if it gets fixed in the 
next release of the library...)


Post a reply to this message

From: Invisible
Subject: Re: New BPM
Date: 10 Jun 2010 04:18:27
Message: <4c109fd3$1@news.povray.org>
scott wrote:

> Well just start it at roughly the right time and have the thread loop 
> until it's exactly the correct time.

I'm not keen on burning shedloads of CPU power just because of a 
deficiency in the thread library. But we'll see...


Post a reply to this message

From: scott
Subject: Re: New BPM
Date: 10 Jun 2010 04:33:39
Message: <4c10a363$1@news.povray.org>
>> Well just start it at roughly the right time and have the thread loop 
>> until it's exactly the correct time.
>
> I'm not keen on burning shedloads of CPU power just because of a 
> deficiency in the thread library. But we'll see...

Well issue a sleep command at the top until you are roughly at the correct 
time, then loop until you are exactly there.  You shouldn't be burning more 
than 0.1 or 0.2% CPU this way.


Post a reply to this message

From: Darren New
Subject: Re: Microcode
Date: 10 Jun 2010 12:00:41
Message: <4c110c29$1@news.povray.org>
Invisible wrote:
> Darren New wrote:
>> Invisible wrote:
>>> Note also that the 6502 doesn't have any microcode. 
>>
>> Given how the instruction sets decoded, I'm not sure it's really valid 
>> to say it had no microcode.
> 
> And you actually know how it was wired up internally, do you?

Yes. There was a very interesting article on it showing how it worked, 
somewhere.  I'll see if I can find it.

-- 
Darren New, San Diego CA, USA (PST)
    Eiffel - The language that lets you specify exactly
    that the code does what you think it does, even if
    it doesn't do what you wanted.


Post a reply to this message

From: Darren New
Subject: Re: Microcode
Date: 10 Jun 2010 12:16:26
Message: <4c110fda@news.povray.org>
Invisible wrote:
> And you actually know how it was wired up internally, do you?


http://www.pagetable.com/?p=39

Actually, I'll grant it's not microcode per se, but it's a table-driven 
system with a multiple-cycle-per-instruction clock that steps thru the 
table, so now it's an argument more over "what is microcode" than it is over 
whether a 6502 has microcode.

I'd say anything that steps thru a ROM with a counter during one instruction 
is probably microcode, myself.

-- 
Darren New, San Diego CA, USA (PST)
    Eiffel - The language that lets you specify exactly
    that the code does what you think it does, even if
    it doesn't do what you wanted.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.