Yes, of course, this still *is* nothing more than an event loop, ...
A decent event loop should use an OS API to free the processor until the
next event is scheduled:
Meta code:
repeat
if (event in event queue) begin // this is either an OS API call or
the event queue is done with user
Thanks for CDQ info, I didn't know it existed :)
I just made the algotithm because I needed speedy div and mod, that could
handle signed and unsigned Int32, also with a Int32 as divisor. And the one
in Delphi6/7 doesn't do that.
I haven't used assembler since 1985 on a Dragon32, so I have a
Op Thu, 9 Nov 2006, schreef Kai Olav Fredriksen:
It might be that it could be a lot better, I hope someone could tell me how.
asm
push ebx
mov ebx,edx
cdq
idiv ebx
mov [ecx],edx
pop ebx
end;
Daniël___
fpc-devel maillist -
Thanks for CDQ info, I didn't know it existed :)
I just made the algotithm because I needed speedy div and mod, that could
handle signed and unsigned Int32, also with a Int32 as divisor. And the
one
in Delphi6/7 doesn't do that.
I haven't used assembler since 1985 on a Dragon32, so I have a
On Thursday 09 November 2006 08:22, Michael Schnell wrote:
Yes, of course, this still *is* nothing more than an event loop,
...
A decent event loop should use an OS API to free the processor until
the next event is scheduled:
That's why I wrote the example in Esterel.
Give me that API and
Alas, Object Pascal
lacks a decent portable OS tasking interface.
With Delphi we successfully used Windows Messages for inter Thread
communication.
With FPC on Linux a friend of mine used System 5 Messages queues for the
same purpose.
So IMHO inter Thread messages is a good way to go.
Peter Vreman wrote:
oldval:=value
divval:=value div divider
modval:=oldval-divval
I don't see how this is correct ? And why you need oldval, you don't
modify value ?
oldval=5
divval=5 div 2=2
modval=5-2=3
Micha
___
fpc-devel maillist -
of course... :) it lost 2 milliseconds on the assembly code in 100 million
iterations.
Thank you Peter and Daniël
Kai
-- Peter Vreman wrote :
If you need both the div and mod you can use a single divsion and
subtraction:
oldval:=value
divval:=value div divider
modval:=oldval-divval
This
Peter Vreman wrote:
oldval:=value
divval:=value div divider
modval:=oldval-divval
I don't see how this is correct ? And why you need oldval, you don't
modify value ?
oldval=5
divval=5 div 2=2
modval=5-2=3
Mistake... it should have been:
modval=oldval-(divval*divider)
oldval=5
On Thu, 9 Nov 2006, Michael Schnell wrote:
Alas, Object Pascal lacks a decent portable OS tasking interface.
With Delphi we successfully used Windows Messages for inter Thread
communication.
With FPC on Linux a friend of mine used System 5 Messages queues for the same
purpose.
Why don't you simply go ahead, implement something (cross-platform) and then
we can see how this can be integrated in FPC, if this integration is needed at all...
I did do first steps of this already some years ago. I hope I will be
able to start over in January.
-Michael
BTW.:
TPC comes with Free Vision.
The FPC IDE based on Free Vision seems to work fine.
The Free Vision Non-GUI seems to be event driven and thus needs to
implement a kind of event scheduler.
Maybe same might be worth looking at.
-Michael
___
Hello,
When I try to create a cross compile of fpc 2.0.4 to i386 (I'm using
amd64 native ubuntu edgy).
When I try to compile it as following:
make all tar CPU_TARGET=i386 CROSSINSTALL=1 INSTALL_PREFIX=/usr/lib
It compiles, until it needs to create a tar file and then I have the
following error
Hello,
When I try to create a cross compile of fpc 2.0.4 to i386 (I'm using
amd64 native ubuntu edgy).
When I try to compile it as following:
make all tar CPU_TARGET=i386 CROSSINSTALL=1 INSTALL_PREFIX=/usr/lib
It compiles, until it needs to create a tar file and then I have the
following
On 11/9/06, Peter Vreman [EMAIL PROTECTED] wrote:
Hello,
When I try to create a cross compile of fpc 2.0.4 to i386 (I'm using
amd64 native ubuntu edgy).
When I try to compile it as following:
make all tar CPU_TARGET=i386 CROSSINSTALL=1 INSTALL_PREFIX=/usr/lib
It compiles, until it needs
Michael Schnell schrieb:
BTW.:
TPC comes with Free Vision.
The FPC IDE based on Free Vision seems to work fine.
The Free Vision Non-GUI seems to be event driven and thus needs to
implement a kind of event scheduler.
It's an event handling loop using queues for input events. Very primitive
On 11/9/06, ik [EMAIL PROTECTED] wrote:
On 11/9/06, Peter Vreman [EMAIL PROTECTED] wrote:
Hello,
When I try to create a cross compile of fpc 2.0.4 to i386 (I'm using
amd64 native ubuntu edgy).
When I try to compile it as following:
make all tar CPU_TARGET=i386 CROSSINSTALL=1
Op Thu, 9 Nov 2006, schreef Florian Klaempfl:
Michael Schnell schrieb:
BTW.:
TPC comes with Free Vision.
The FPC IDE based on Free Vision seems to work fine.
The Free Vision Non-GUI seems to be event driven and thus needs to
implement a kind of event scheduler.
It's an
Daniël Mantione wrote:
Add to this the enable/disable system of commands. I.e. disable cmCut and all
menu
bars, status bars, buttons, context menu's and whatever thing
that can generate a cmCut turns grey.
In Delphi/VCL this is called a TAction, which can be assigned to
speedbutton,
On 11/9/06, ik [EMAIL PROTECTED] wrote:
On 11/9/06, Peter Vreman [EMAIL PROTECTED] wrote:
Hello,
When I try to create a cross compile of fpc 2.0.4 to i386 (I'm using
amd64 native ubuntu edgy).
When I try to compile it as following:
make all tar CPU_TARGET=i386 CROSSINSTALL=1
Jonas Maebe schrieb:
I think such updating could in fact be perfectly done by
someone else than the core developers. In general you don't need
intricate knowledge of the compiler or other things. Before committing,
just check whether everything still compiles after merging and whether
there
On Thu, 9 Nov 2006, Daniël Mantione wrote:
Op Thu, 9 Nov 2006, schreef Florian Klaempfl:
Michael Schnell schrieb:
BTW.:
TPC comes with Free Vision.
The FPC IDE based on Free Vision seems to work fine.
The Free Vision Non-GUI seems to be event driven and thus
On Thu, 9 Nov 2006, Micha Nelissen wrote:
Daniël Mantione wrote:
Add to this the enable/disable system of commands. I.e. disable cmCut and
all menu
bars, status bars, buttons, context menu's and whatever thing
that can generate a cmCut turns grey.
In Delphi/VCL this is called a
23 matches
Mail list logo