Board index » delphi » Can I run two procedures simultaneously?
removeme.shad...@erols.com (jacob)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
removeme.shad...@erols.com (jacob)
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Can I run two procedures simultaneously?
Hi,
I'm pretty new to programming and though I have played with TP7 a Instead of waiting for one procedure to finish and going to a 2nd one I think this is called multi-threading in Windows, but I have no idea Thanks in advance. |
Pedt Scrag
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?jacob [mailto:removeme.shad...@erols.com] decided to regale us with Quote>Instead of waiting for one procedure to finish and going to a 2nd one (programmer has to explicitly call a procedure) or true (works without programmer calling a procedure). Pseudo multitasking is far easier to implement. SWAG has some units http://www.gdsoft.com/swag/ -- |
Mike{*word*106}s
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?QuoteIn article <36a183e8.39399...@news.erols.com> removeme.shad...@erols.com wrote... input' routine(s) check something like this; if Keypressed A better solution would probably to use a toolkit like Object Mike{*word*106}son, Black Cat Software Factory, Edinburgh, Scotland |
Frederi
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?Quotejacob wrote: generally new to programming, the following might maybe not yet be very clear to you. Sorry in this case. It is possible by using an interrupt procedure that hooks interrupt 1Ch. procedure 1 being executed and this happens approximately 18.2 times a second. I suggest you consider the following program. What it does is simply uses crt, dos; procedure MeasureTime; interrupt; { The following simply writes the number of times the interrupt procedure Enter_Your_Name; begin Enter_Your_Name; writeln('You took ', calls / 18.2:2:2, ' sec. to enter your name'); |
jaco
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?QuoteOn Sun, 17 Jan 1999 12:06:46 +0100, Frederic <f...@rz-online.de> wrote: what the lines GetIntVec and SetIntVec do. I've looked in the help of TP 7, but I'm afraid its just over my head for now. Can you recommend a good book or perhaps an internet site explaining this stuff? |
Frédéri
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?jacob schrieb: Quote> This is pretty cool; thanks. Unfortunatly, I'm not too clear as to explanation: A software interrupt routine is a routine provided by DOS, for example. It is There is one interrupt, number 28 (1Ch), which is called approximately 18.2 You can "hook" an interrupt. This means that you write a procedure, and tell SetIntVec($1C, Addr(Your_Procedure)) sets the interrupt vector of interrupt Now, what, when your program is terminating. You don't need the interrupt var procedure MyRoutine; interrupt; begin { Your regular program } SetIntVec($1C, OldVector) { Restore the old vector } Be wary of not making the interrupt routine last longer than 1 / 18.2 second. I hope this helps you to get started. Later you will see that it is not this |
Algirdas Kepezinska
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?Quote> Be wary of not making the interrupt routine last longer than 1 / 18.2 second. procedure is still running and dont start it once again. -- |
Frédéri
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?Algirdas Kepezinskas schrieb: Quote> > Be wary of not making the interrupt routine last longer than 1 / 18.2 second. irrevocably called 18.2 times a second by the system. There is no (simple) way to alter this behavior. If you mean the stack pointer with sp: it is not really a good idea. You cannot |
Algirdas Kepezinska
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Can I run two procedures simultaneously?no, you didnt get me right. I mean it is possible, once a procedure is started (lets say we know it _will_ last longer then 1/18.2 second), to set lets say runnign bollean to true, and on the start of procedure we do check: if not runnging then this way, procedure wont be called until it will finish. It is tested:) Quote> > > Be wary of not making the interrupt routine last longer than 1 / 18.2 second. Ze{*word*104} [E-MAIL: cy...@vil.ktu.lt] [HP: not-yet] ?????????????????? ICQ: 14187537 ??????? If Time Is Killing You - Kill Some For Time ? |
1. Running two forms simultaneously
2. Help:two application threads access paradox table simultaneously
3. Updating two tables simultaneously
4. Access to different tables in the same Database in two different threads simultaneously
5. How can I prevent an application to run twice simultaneously
6. How can I prevent an application to run twice simultaneously
7. Simultaneously running applications
8. 2 apps running simultaneously