Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Schnell
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

Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread Kai Olav Fredriksen
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

Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread Daniël Mantione
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 -

Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread Peter Vreman
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Vinzent Hoefler
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Schnell
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.

Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread Micha Nelissen
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 -

Re: Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread k
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

Re: [fpc-devel] Math.DivMod results should be signed

2006-11-09 Thread Peter Vreman
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Van Canneyt
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.

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Schnell
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Schnell
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 ___

[fpc-devel] Cross compiling issues

2006-11-09 Thread ik
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

Re: [fpc-devel] Cross compiling issues

2006-11-09 Thread Peter Vreman
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

Re: [fpc-devel] Cross compiling issues

2006-11-09 Thread ik
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread 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 event handling loop using queues for input events. Very primitive

Re: [fpc-devel] Cross compiling issues

2006-11-09 Thread ik
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Daniël Mantione
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Micha Nelissen
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,

Re: [fpc-devel] Cross compiling issues

2006-11-09 Thread Peter Vreman
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

Re: [fpc-devel] Bug 0007281 / MemLeak with interfaces

2006-11-09 Thread Florian Klaempfl
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Van Canneyt
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

Re: [fpc-devel] Threads and alot of crap continued

2006-11-09 Thread Michael Van Canneyt
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