Changeset 152
- Timestamp:
- Jan 27, 2011, 10:30:55 AM (14 years ago)
- Location:
- MicroThreading
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
MicroThreading/Demo/Demo.lpi
r151 r152 39 39 </Item2> 40 40 </RequiredPackages> 41 <Units Count=" 57">41 <Units Count="61"> 42 42 <Unit0> 43 43 <Filename Value="Demo.lpr"/> … … 47 47 <TopLine Value="1"/> 48 48 <CursorPos X="5" Y="9"/> 49 <UsageCount Value="6 2"/>49 <UsageCount Value="67"/> 50 50 </Unit0> 51 51 <Unit1> … … 57 57 <EditorIndex Value="0"/> 58 58 <WindowIndex Value="0"/> 59 <TopLine Value="2 52"/>60 <CursorPos X="1" Y="2 74"/>61 <UsageCount Value="6 2"/>59 <TopLine Value="268"/> 60 <CursorPos X="1" Y="288"/> 61 <UsageCount Value="67"/> 62 62 <Loaded Value="True"/> 63 63 <LoadedDesigner Value="True"/> … … 67 67 <UnitName Value="UMicroThreading"/> 68 68 <IsVisibleTab Value="True"/> 69 <EditorIndex Value=" 1"/>70 <WindowIndex Value="0"/> 71 <TopLine Value="2 58"/>72 <CursorPos X=" 1" Y="271"/>73 <UsageCount Value="3 4"/>69 <EditorIndex Value="2"/> 70 <WindowIndex Value="0"/> 71 <TopLine Value="272"/> 72 <CursorPos X="23" Y="288"/> 73 <UsageCount Value="37"/> 74 74 <Loaded Value="True"/> 75 75 </Unit2> … … 80 80 <TopLine Value="55"/> 81 81 <CursorPos X="3" Y="70"/> 82 <UsageCount Value=" 10"/>82 <UsageCount Value="9"/> 83 83 </Unit3> 84 84 <Unit4> … … 87 87 <TopLine Value="346"/> 88 88 <CursorPos X="24" Y="351"/> 89 <UsageCount Value=" 8"/>89 <UsageCount Value="7"/> 90 90 </Unit4> 91 91 <Unit5> … … 94 94 <TopLine Value="1"/> 95 95 <CursorPos X="1" Y="1"/> 96 <UsageCount Value=" 8"/>96 <UsageCount Value="7"/> 97 97 <DefaultSyntaxHighlighter Value="XML"/> 98 98 </Unit5> … … 103 103 <TopLine Value="286"/> 104 104 <CursorPos X="1" Y="1"/> 105 <UsageCount Value=" 8"/>105 <UsageCount Value="7"/> 106 106 </Unit6> 107 107 <Unit7> … … 111 111 <TopLine Value="1"/> 112 112 <CursorPos X="1" Y="8"/> 113 <UsageCount Value=" 10"/>113 <UsageCount Value="9"/> 114 114 <DefaultSyntaxHighlighter Value="Delphi"/> 115 115 </Unit7> … … 120 120 <TopLine Value="56"/> 121 121 <CursorPos X="24" Y="77"/> 122 <UsageCount Value="1 9"/>122 <UsageCount Value="18"/> 123 123 <DefaultSyntaxHighlighter Value="Delphi"/> 124 124 </Unit8> … … 129 129 <TopLine Value="264"/> 130 130 <CursorPos X="37" Y="141"/> 131 <UsageCount Value="1 9"/>131 <UsageCount Value="18"/> 132 132 <DefaultSyntaxHighlighter Value="Delphi"/> 133 133 </Unit9> … … 138 138 <TopLine Value="302"/> 139 139 <CursorPos X="5" Y="33"/> 140 <UsageCount Value=" 8"/>140 <UsageCount Value="7"/> 141 141 </Unit10> 142 142 <Unit11> … … 145 145 <TopLine Value="479"/> 146 146 <CursorPos X="3" Y="494"/> 147 <UsageCount Value="1 1"/>147 <UsageCount Value="10"/> 148 148 </Unit11> 149 149 <Unit12> … … 152 152 <TopLine Value="1046"/> 153 153 <CursorPos X="34" Y="1053"/> 154 <UsageCount Value="1 7"/>154 <UsageCount Value="16"/> 155 155 </Unit12> 156 156 <Unit13> … … 159 159 <TopLine Value="317"/> 160 160 <CursorPos X="1" Y="341"/> 161 <UsageCount Value=" 10"/>161 <UsageCount Value="9"/> 162 162 </Unit13> 163 163 <Unit14> … … 166 166 <TopLine Value="45"/> 167 167 <CursorPos X="1" Y="62"/> 168 <UsageCount Value=" 10"/>168 <UsageCount Value="9"/> 169 169 </Unit14> 170 170 <Unit15> … … 173 173 <TopLine Value="1670"/> 174 174 <CursorPos X="1" Y="1685"/> 175 <UsageCount Value="1 1"/>175 <UsageCount Value="10"/> 176 176 </Unit15> 177 177 <Unit16> … … 181 181 <TopLine Value="290"/> 182 182 <CursorPos X="36" Y="306"/> 183 <UsageCount Value=" 20"/>183 <UsageCount Value="19"/> 184 184 </Unit16> 185 185 <Unit17> … … 188 188 <TopLine Value="67"/> 189 189 <CursorPos X="10" Y="91"/> 190 <UsageCount Value=" 8"/>190 <UsageCount Value="7"/> 191 191 </Unit17> 192 192 <Unit18> … … 195 195 <TopLine Value="1823"/> 196 196 <CursorPos X="3" Y="1838"/> 197 <UsageCount Value="1 2"/>197 <UsageCount Value="11"/> 198 198 </Unit18> 199 199 <Unit19> … … 202 202 <TopLine Value="1348"/> 203 203 <CursorPos X="1" Y="1363"/> 204 <UsageCount Value=" 10"/>204 <UsageCount Value="9"/> 205 205 </Unit19> 206 206 <Unit20> … … 209 209 <TopLine Value="32"/> 210 210 <CursorPos X="48" Y="50"/> 211 <UsageCount Value=" 9"/>211 <UsageCount Value="8"/> 212 212 </Unit20> 213 213 <Unit21> … … 216 216 <TopLine Value="8"/> 217 217 <CursorPos X="11" Y="25"/> 218 <UsageCount Value="1 1"/>218 <UsageCount Value="10"/> 219 219 </Unit21> 220 220 <Unit22> … … 224 224 <TopLine Value="1"/> 225 225 <CursorPos X="25" Y="9"/> 226 <UsageCount Value="1 2"/>226 <UsageCount Value="11"/> 227 227 </Unit22> 228 228 <Unit23> … … 231 231 <TopLine Value="38"/> 232 232 <CursorPos X="29" Y="50"/> 233 <UsageCount Value="1 6"/>233 <UsageCount Value="15"/> 234 234 </Unit23> 235 235 <Unit24> … … 238 238 <TopLine Value="106"/> 239 239 <CursorPos X="10" Y="119"/> 240 <UsageCount Value="1 9"/>240 <UsageCount Value="18"/> 241 241 </Unit24> 242 242 <Unit25> … … 245 245 <TopLine Value="254"/> 246 246 <CursorPos X="12" Y="258"/> 247 <UsageCount Value="1 2"/>247 <UsageCount Value="11"/> 248 248 </Unit25> 249 249 <Unit26> … … 253 253 <TopLine Value="581"/> 254 254 <CursorPos X="11" Y="585"/> 255 <UsageCount Value="1 2"/>255 <UsageCount Value="11"/> 256 256 </Unit26> 257 257 <Unit27> … … 260 260 <TopLine Value="525"/> 261 261 <CursorPos X="11" Y="538"/> 262 <UsageCount Value="1 2"/>262 <UsageCount Value="11"/> 263 263 </Unit27> 264 264 <Unit28> … … 268 268 <TopLine Value="57"/> 269 269 <CursorPos X="16" Y="70"/> 270 <UsageCount Value="1 3"/>270 <UsageCount Value="12"/> 271 271 </Unit28> 272 272 <Unit29> … … 275 275 <TopLine Value="18"/> 276 276 <CursorPos X="50" Y="31"/> 277 <UsageCount Value="1 3"/>277 <UsageCount Value="12"/> 278 278 </Unit29> 279 279 <Unit30> … … 282 282 <TopLine Value="109"/> 283 283 <CursorPos X="3" Y="112"/> 284 <UsageCount Value="1 3"/>284 <UsageCount Value="12"/> 285 285 </Unit30> 286 286 <Unit31> … … 289 289 <TopLine Value="12"/> 290 290 <CursorPos X="3" Y="25"/> 291 <UsageCount Value="1 3"/>291 <UsageCount Value="12"/> 292 292 </Unit31> 293 293 <Unit32> 294 294 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/classesh.inc"/> 295 <WindowIndex Value="0"/> 296 <TopLine Value="1504"/> 297 <CursorPos X="1" Y="1510"/> 298 <UsageCount Value="16"/> 295 <EditorIndex Value="6"/> 296 <WindowIndex Value="0"/> 297 <TopLine Value="1466"/> 298 <CursorPos X="15" Y="1479"/> 299 <UsageCount Value="18"/> 300 <Loaded Value="True"/> 299 301 </Unit32> 300 302 <Unit33> 301 303 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/win/tthread.inc"/> 302 <WindowIndex Value="0"/> 303 <TopLine Value="96"/> 304 <CursorPos X="15" Y="98"/> 305 <UsageCount Value="13"/> 304 <EditorIndex Value="7"/> 305 <WindowIndex Value="0"/> 306 <TopLine Value="52"/> 307 <CursorPos X="23" Y="55"/> 308 <UsageCount Value="15"/> 309 <Loaded Value="True"/> 306 310 </Unit33> 307 311 <Unit34> … … 310 314 <TopLine Value="130"/> 311 315 <CursorPos X="10" Y="143"/> 312 <UsageCount Value="1 3"/>316 <UsageCount Value="12"/> 313 317 </Unit34> 314 318 <Unit35> … … 317 321 <TopLine Value="1923"/> 318 322 <CursorPos X="6" Y="1936"/> 319 <UsageCount Value="1 3"/>323 <UsageCount Value="12"/> 320 324 </Unit35> 321 325 <Unit36> 322 326 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/classes.inc"/> 323 <WindowIndex Value="0"/> 324 <TopLine Value="109"/> 325 <CursorPos X="3" Y="111"/> 326 <UsageCount Value="16"/> 327 <EditorIndex Value="8"/> 328 <WindowIndex Value="0"/> 329 <TopLine Value="85"/> 330 <CursorPos X="21" Y="107"/> 331 <UsageCount Value="18"/> 332 <Loaded Value="True"/> 327 333 </Unit36> 328 334 <Unit37> … … 331 337 <TopLine Value="181"/> 332 338 <CursorPos X="21" Y="194"/> 333 <UsageCount Value="1 3"/>339 <UsageCount Value="12"/> 334 340 </Unit37> 335 341 <Unit38> 336 342 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/sysutils/osutilsh.inc"/> 343 <EditorIndex Value="3"/> 337 344 <WindowIndex Value="0"/> 338 345 <TopLine Value="14"/> 339 346 <CursorPos X="11" Y="27"/> 340 347 <UsageCount Value="13"/> 348 <Loaded Value="True"/> 341 349 </Unit38> 342 350 <Unit39> … … 345 353 <TopLine Value="2275"/> 346 354 <CursorPos X="39" Y="2285"/> 347 <UsageCount Value="1 2"/>355 <UsageCount Value="11"/> 348 356 </Unit39> 349 357 <Unit40> … … 352 360 <TopLine Value="492"/> 353 361 <CursorPos X="3" Y="504"/> 354 <UsageCount Value=" 10"/>362 <UsageCount Value="9"/> 355 363 </Unit40> 356 364 <Unit41> … … 359 367 <TopLine Value="197"/> 360 368 <CursorPos X="30" Y="208"/> 361 <UsageCount Value=" 10"/>369 <UsageCount Value="9"/> 362 370 </Unit41> 363 371 <Unit42> … … 366 374 <TopLine Value="737"/> 367 375 <CursorPos X="21" Y="747"/> 368 <UsageCount Value=" 10"/>376 <UsageCount Value="9"/> 369 377 </Unit42> 370 378 <Unit43> … … 373 381 <TopLine Value="96"/> 374 382 <CursorPos X="1" Y="1"/> 375 <UsageCount Value=" 10"/>383 <UsageCount Value="9"/> 376 384 </Unit43> 377 385 <Unit44> … … 380 388 <TopLine Value="221"/> 381 389 <CursorPos X="1" Y="235"/> 382 <UsageCount Value="1 3"/>390 <UsageCount Value="12"/> 383 391 </Unit44> 384 392 <Unit45> … … 387 395 <TopLine Value="387"/> 388 396 <CursorPos X="1" Y="400"/> 389 <UsageCount Value="1 3"/>397 <UsageCount Value="12"/> 390 398 </Unit45> 391 399 <Unit46> … … 394 402 <TopLine Value="6081"/> 395 403 <CursorPos X="6" Y="6094"/> 396 <UsageCount Value="1 3"/>404 <UsageCount Value="12"/> 397 405 </Unit46> 398 406 <Unit47> … … 401 409 <TopLine Value="160"/> 402 410 <CursorPos X="12" Y="163"/> 403 <UsageCount Value=" 10"/>411 <UsageCount Value="9"/> 404 412 </Unit47> 405 413 <Unit48> 406 414 <Filename Value="../UPlatform.pas"/> 407 415 <UnitName Value="UPlatform"/> 408 <EditorIndex Value=" 2"/>416 <EditorIndex Value="10"/> 409 417 <WindowIndex Value="0"/> 410 418 <TopLine Value="1"/> 411 419 <CursorPos X="24" Y="9"/> 412 <UsageCount Value="1 4"/>420 <UsageCount Value="17"/> 413 421 <Loaded Value="True"/> 414 422 </Unit48> … … 418 426 <TopLine Value="9153"/> 419 427 <CursorPos X="8" Y="9166"/> 420 <UsageCount Value=" 10"/>428 <UsageCount Value="9"/> 421 429 </Unit49> 422 430 <Unit50> … … 426 434 <TopLine Value="1"/> 427 435 <CursorPos X="1" Y="1"/> 428 <UsageCount Value=" 10"/>436 <UsageCount Value="9"/> 429 437 </Unit50> 430 438 <Unit51> … … 433 441 <TopLine Value="2380"/> 434 442 <CursorPos X="30" Y="2390"/> 435 <UsageCount Value=" 10"/>443 <UsageCount Value="9"/> 436 444 </Unit51> 437 445 <Unit52> … … 440 448 <TopLine Value="150"/> 441 449 <CursorPos X="55" Y="162"/> 442 <UsageCount Value=" 10"/>450 <UsageCount Value="9"/> 443 451 </Unit52> 444 452 <Unit53> … … 447 455 <TopLine Value="5227"/> 448 456 <CursorPos X="1" Y="5242"/> 449 <UsageCount Value=" 10"/>457 <UsageCount Value="9"/> 450 458 </Unit53> 451 459 <Unit54> … … 455 463 <TopLine Value="102"/> 456 464 <CursorPos X="1" Y="121"/> 457 <UsageCount Value=" 10"/>465 <UsageCount Value="9"/> 458 466 </Unit54> 459 467 <Unit55> … … 462 470 <TopLine Value="3515"/> 463 471 <CursorPos X="1" Y="3531"/> 464 <UsageCount Value=" 10"/>472 <UsageCount Value="9"/> 465 473 </Unit55> 466 474 <Unit56> … … 469 477 <TopLine Value="1159"/> 470 478 <CursorPos X="1" Y="1174"/> 471 <UsageCount Value=" 10"/>479 <UsageCount Value="9"/> 472 480 </Unit56> 481 <Unit57> 482 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/fpc/2.4.3/source/rtl/objpas/classes/lists.inc"/> 483 <EditorIndex Value="9"/> 484 <WindowIndex Value="0"/> 485 <TopLine Value="590"/> 486 <CursorPos X="14" Y="594"/> 487 <UsageCount Value="12"/> 488 <Loaded Value="True"/> 489 </Unit57> 490 <Unit58> 491 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/interfaces/win32/win32callback.inc"/> 492 <EditorIndex Value="5"/> 493 <WindowIndex Value="0"/> 494 <TopLine Value="1086"/> 495 <CursorPos X="1" Y="1099"/> 496 <UsageCount Value="12"/> 497 <Loaded Value="True"/> 498 </Unit58> 499 <Unit59> 500 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/extctrls.pp"/> 501 <UnitName Value="ExtCtrls"/> 502 <EditorIndex Value="1"/> 503 <WindowIndex Value="0"/> 504 <TopLine Value="357"/> 505 <CursorPos X="3" Y="370"/> 506 <UsageCount Value="12"/> 507 <Loaded Value="True"/> 508 </Unit59> 509 <Unit60> 510 <Filename Value="../../../../Programy/Lazarus/0.9.31_2.4.3/lcl/customtimer.pas"/> 511 <UnitName Value="CustomTimer"/> 512 <EditorIndex Value="4"/> 513 <WindowIndex Value="0"/> 514 <TopLine Value="40"/> 515 <CursorPos X="17" Y="53"/> 516 <UsageCount Value="11"/> 517 <Loaded Value="True"/> 518 </Unit60> 473 519 </Units> 474 <JumpHistory Count="30" HistoryIndex="2 9">520 <JumpHistory Count="30" HistoryIndex="28"> 475 521 <Position1> 476 522 <Filename Value="../UMicroThreading.pas"/> 477 <Caret Line="2 57" Column="1" TopLine="241"/>523 <Caret Line="299" Column="1" TopLine="280"/> 478 524 </Position1> 479 525 <Position2> 480 526 <Filename Value="../UMicroThreading.pas"/> 481 <Caret Line=" 258" Column="1" TopLine="241"/>527 <Caret Line="300" Column="1" TopLine="280"/> 482 528 </Position2> 483 529 <Position3> 484 530 <Filename Value="../UMicroThreading.pas"/> 485 <Caret Line=" 261" Column="1" TopLine="241"/>531 <Caret Line="301" Column="1" TopLine="280"/> 486 532 </Position3> 487 533 <Position4> 488 534 <Filename Value="../UMicroThreading.pas"/> 489 <Caret Line="3 21" Column="13" TopLine="311"/>535 <Caret Line="302" Column="1" TopLine="283"/> 490 536 </Position4> 491 537 <Position5> 492 538 <Filename Value="../UMicroThreading.pas"/> 493 <Caret Line=" 116" Column="1" TopLine="103"/>539 <Caret Line="465" Column="1" TopLine="452"/> 494 540 </Position5> 495 541 <Position6> 496 542 <Filename Value="../UMicroThreading.pas"/> 497 <Caret Line=" 326" Column="1" TopLine="307"/>543 <Caret Line="468" Column="1" TopLine="452"/> 498 544 </Position6> 499 545 <Position7> 500 546 <Filename Value="../UMicroThreading.pas"/> 501 <Caret Line=" 183" Column="3" TopLine="159"/>547 <Caret Line="469" Column="1" TopLine="452"/> 502 548 </Position7> 503 549 <Position8> 504 550 <Filename Value="../UMicroThreading.pas"/> 505 <Caret Line=" 281" Column="40" TopLine="266"/>551 <Caret Line="470" Column="1" TopLine="452"/> 506 552 </Position8> 507 553 <Position9> 508 554 <Filename Value="../UMicroThreading.pas"/> 509 <Caret Line=" 183" Column="1" TopLine="172"/>555 <Caret Line="226" Column="1" TopLine="213"/> 510 556 </Position9> 511 557 <Position10> 512 558 <Filename Value="../UMicroThreading.pas"/> 513 <Caret Line=" 683" Column="3" TopLine="660"/>559 <Caret Line="304" Column="1" TopLine="291"/> 514 560 </Position10> 515 561 <Position11> 516 562 <Filename Value="../UMicroThreading.pas"/> 517 <Caret Line=" 273" Column="21" TopLine="260"/>563 <Caret Line="312" Column="1" TopLine="291"/> 518 564 </Position11> 519 565 <Position12> 520 566 <Filename Value="../UMicroThreading.pas"/> 521 <Caret Line=" 281" Column="1" TopLine="269"/>567 <Caret Line="329" Column="1" TopLine="316"/> 522 568 </Position12> 523 569 <Position13> 524 570 <Filename Value="../UMicroThreading.pas"/> 525 <Caret Line="2 82" Column="40" TopLine="269"/>571 <Caret Line="227" Column="1" TopLine="214"/> 526 572 </Position13> 527 573 <Position14> 528 574 <Filename Value="../UMicroThreading.pas"/> 529 <Caret Line="2 81" Column="44" TopLine="269"/>575 <Caret Line="228" Column="1" TopLine="214"/> 530 576 </Position14> 531 577 <Position15> 532 578 <Filename Value="../UMicroThreading.pas"/> 533 <Caret Line=" 282" Column="1" TopLine="269"/>579 <Caret Line="351" Column="1" TopLine="338"/> 534 580 </Position15> 535 581 <Position16> 536 582 <Filename Value="../UMicroThreading.pas"/> 537 <Caret Line=" 281" Column="3" TopLine="269"/>583 <Caret Line="352" Column="1" TopLine="338"/> 538 584 </Position16> 539 585 <Position17> 540 586 <Filename Value="../UMicroThreading.pas"/> 541 <Caret Line=" 282" Column="17" TopLine="263"/>587 <Caret Line="350" Column="1" TopLine="338"/> 542 588 </Position17> 543 589 <Position18> 544 590 <Filename Value="../UMicroThreading.pas"/> 545 <Caret Line=" 402" Column="1" TopLine="389"/>591 <Caret Line="351" Column="35" TopLine="338"/> 546 592 </Position18> 547 593 <Position19> 548 594 <Filename Value="../UMicroThreading.pas"/> 549 <Caret Line="27 0" Column="48" TopLine="262"/>595 <Caret Line="279" Column="19" TopLine="267"/> 550 596 </Position19> 551 597 <Position20> 552 598 <Filename Value="../UMicroThreading.pas"/> 553 <Caret Line="2 85" Column="1" TopLine="263"/>599 <Caret Line="295" Column="1" TopLine="270"/> 554 600 </Position20> 555 601 <Position21> 556 602 <Filename Value="../UMicroThreading.pas"/> 557 <Caret Line="28 2" Column="19" TopLine="269"/>603 <Caret Line="289" Column="1" TopLine="270"/> 558 604 </Position21> 559 605 <Position22> 560 606 <Filename Value="../UMicroThreading.pas"/> 561 <Caret Line=" 54" Column="26" TopLine="45"/>607 <Caret Line="290" Column="1" TopLine="270"/> 562 608 </Position22> 563 609 <Position23> 564 610 <Filename Value="../UMicroThreading.pas"/> 565 <Caret Line="2 83" Column="1" TopLine="270"/>611 <Caret Line="291" Column="1" TopLine="270"/> 566 612 </Position23> 567 613 <Position24> 568 614 <Filename Value="../UMicroThreading.pas"/> 569 <Caret Line=" 394" Column="1" TopLine="381"/>615 <Caret Line="292" Column="1" TopLine="270"/> 570 616 </Position24> 571 617 <Position25> 572 618 <Filename Value="../UMicroThreading.pas"/> 573 <Caret Line=" 385" Column="1" TopLine="380"/>619 <Caret Line="598" Column="50" TopLine="587"/> 574 620 </Position25> 575 621 <Position26> 576 622 <Filename Value="../UMicroThreading.pas"/> 577 <Caret Line=" 386" Column="1" TopLine="380"/>623 <Caret Line="291" Column="40" TopLine="278"/> 578 624 </Position26> 579 625 <Position27> 580 <Filename Value=" UMainForm.pas"/>581 <Caret Line="2 74" Column="1" TopLine="252"/>626 <Filename Value="../UMicroThreading.pas"/> 627 <Caret Line="280" Column="1" TopLine="272"/> 582 628 </Position27> 583 629 <Position28> 584 630 <Filename Value="../UMicroThreading.pas"/> 585 <Caret Line="28 7" Column="43" TopLine="269"/>631 <Caret Line="288" Column="26" TopLine="272"/> 586 632 </Position28> 587 633 <Position29> 588 634 <Filename Value="../UMicroThreading.pas"/> 589 <Caret Line="28 6" Column="1" TopLine="269"/>635 <Caret Line="285" Column="35" TopLine="272"/> 590 636 </Position29> 591 637 <Position30> 592 638 <Filename Value="../UMicroThreading.pas"/> 593 <Caret Line=" 181" Column="3" TopLine="160"/>639 <Caret Line="397" Column="18" TopLine="393"/> 594 640 </Position30> 595 641 </JumpHistory> … … 629 675 </CompilerOptions> 630 676 <Debugging> 677 <BreakPoints Count="4"> 678 <Item1> 679 <Source Value="../UMicroThreading.pas"/> 680 <Line Value="296"/> 681 </Item1> 682 <Item2> 683 <Source Value="../UMicroThreading.pas"/> 684 <Line Value="371"/> 685 </Item2> 686 <Item3> 687 <Source Value="../UMicroThreading.pas"/> 688 <Line Value="471"/> 689 </Item3> 690 <Item4> 691 <Source Value="../UMicroThreading.pas"/> 692 <Line Value="288"/> 693 </Item4> 694 </BreakPoints> 695 <Watches Count="2"> 696 <Item1> 697 <Expression Value="TMicroThread(MainForm.Scheduler.FMicroThreads[0]).FStackPointer"/> 698 </Item1> 699 <Item2> 700 <Expression Value="TMicroThread(MainForm.Scheduler.FMicroThreads[0]).FBasePointer"/> 701 </Item2> 702 </Watches> 631 703 <Exceptions Count="3"> 632 704 <Item1> -
MicroThreading/Demo/UMainForm.lfm
r151 r152 17 17 Top = 8 18 18 Width = 761 19 ActivePage = TabSheet 119 ActivePage = TabSheet2 20 20 Anchors = [akTop, akLeft, akRight, akBottom] 21 TabIndex = 021 TabIndex = 1 22 22 TabOrder = 0 23 23 object TabSheet1: TTabSheet … … 58 58 MaxValue = 100000 59 59 MinValue = 1 60 TabStop = False 60 61 TabOrder = 2 61 Value = 2 0062 Value = 2 62 63 end 63 64 object Memo1: TMemo … … 95 96 OnChange = SpinEdit3Change 96 97 TabOrder = 5 97 Value = 100000 98 Value = 1000000 98 99 end 99 100 end … … 244 245 TabOrder = 1 245 246 end 247 object CheckBoxUseMainThread: TCheckBox 248 Left = 10 249 Height = 17 250 Top = 64 251 Width = 98 252 Caption = 'Use main thread' 253 OnChange = CheckBoxUseMainThreadChange 254 TabOrder = 2 255 end 246 256 end 247 257 end -
MicroThreading/Demo/UMainForm.pas
r151 r152 21 21 ButtonSchedulerStartStop: TButton; 22 22 ButtonShowThreadId: TButton; 23 CheckBoxUseMainThread: TCheckBox; 23 24 GroupBox1: TGroupBox; 24 25 GroupBox2: TGroupBox; … … 53 54 procedure ButtonShowThreadIdClick(Sender: TObject); 54 55 procedure ButtonClearMicroThreadsClick(Sender: TObject); 56 procedure CheckBoxUseMainThreadChange(Sender: TObject); 55 57 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 56 58 procedure FormCreate(Sender: TObject); … … 165 167 begin 166 168 //Scheduler.FMicroThreads.Clear; 167 for I := 0 to SpinEdit1.Value do169 for I := 0 to SpinEdit1.Value - 1 do 168 170 Scheduler.AddMethod(Worker); 169 171 end; … … 199 201 Scheduler.MicroThreadsLock.Release; 200 202 end; 203 end; 204 205 procedure TMainForm.CheckBoxUseMainThreadChange(Sender: TObject); 206 begin 207 Scheduler.UseMainThread := CheckBoxUseMainThread.Checked; 201 208 end; 202 209 -
MicroThreading/UMicroThreading.pas
r151 r152 18 18 cthreads, 19 19 {$ENDIF}{$ENDIF} 20 Classes, SysUtils, Contnrs, SyncObjs, DateUtils, Dialogs, Forms, UPlatform;20 Classes, ExtCtrls, SysUtils, Contnrs, SyncObjs, DateUtils, Dialogs, Forms, UPlatform; 21 21 22 22 const … … 98 98 TMicroThreadThread = class(TThread) 99 99 Manager: TMicroThreadManager; 100 ExecuteTerminated: Boolean; 100 101 procedure Execute; override; 101 102 constructor Create(CreateSuspended: Boolean; … … 119 120 function Execute(Count: Integer): Integer; 120 121 public 122 Id: Integer; 121 123 procedure Yield; 122 124 constructor Create; … … 139 141 FLastId: Integer; 140 142 FFrequency: Int64; 141 F Terminated: Boolean;143 FMainThreadTerminated: Boolean; 142 144 FMicroThreads: TObjectList; // TList<TMicroThread> 143 145 FMainThreadManager: TMicroThreadManager; 144 146 FMicroThreadsLock: TCriticalSection; 145 147 FState: TMicroThreadSchedulerState; 148 FUseMainThread: Boolean; 149 FMainThreadStarter: TTimer; 146 150 function GetMicroThreadCount: Integer; 147 151 function GetThreadPoolCount: Integer; … … 150 154 procedure SetThreadPoolSize(const AValue: Integer); 151 155 function GetNextMicroThread: TMicroThread; 156 procedure ReleaseMicroThread(MicroThread: TMicroThread); 157 procedure SetUseMainThread(const AValue: Boolean); 152 158 procedure Start; 153 159 procedure Stop; 154 160 procedure PoolThreadTerminated(Sender: TObject); 155 161 procedure UpdateThreadPoolSize; 162 procedure MainThreadStart(Sender: TObject); 156 163 public 157 164 function Add(MicroThread: TMicroThread): Integer; … … 168 175 property MainThreadManager: TMicroThreadManager read FMainThreadManager; 169 176 property Active: Boolean read FActive write SetActive; 177 property UseMainThread: Boolean read FUseMainThread write SetUseMainThread; 170 178 end; 171 179 … … 222 230 223 231 procedure TMicroThreadManager.Yield; 224 var 225 I: Integer; 226 CurrentTime: TDateTime; 227 begin 228 CurrentTime := NowPrecise; 232 begin 229 233 if Assigned(FCurrentMicroThread) then begin 230 FCurrentMicroThread.FExecutionEndTime := CurrentTime;234 FCurrentMicroThread.FExecutionEndTime := NowPrecise; 231 235 FCurrentMicroThread.FExecutionTime := FCurrentMicroThread.FExecutionTime + 232 236 (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime); 233 if FCurrentMicroThread.FState = tsRunning then234 FCurrentMicroThread.FState := tsWaiting;235 237 asm 236 238 // Store microthread stack … … 249 251 end; 250 252 FCurrentMicroThread.FManager := nil; 253 FScheduler.ReleaseMicroThread(FCurrentMicroThread); 251 254 FCurrentMicroThread := nil; 252 255 end; 253 256 254 FCurrentMicroThread := FScheduler.GetNextMicroThread; 255 256 if Assigned(FCurrentMicroThread) and (FExecutedCount < FExecuteCount) then begin 257 FCurrentMicroThread.FManager := Self; 258 Inc(FExecutedCount); 259 asm 260 // Store FScheduler stack 261 mov eax, Self 262 mov edx, esp 263 mov [eax].TMicroThreadManager.FStackPointer, edx 264 mov edx, ebp 265 mov [eax].TMicroThreadManager.FBasePointer, edx 266 end; 267 if not FCurrentMicroThread.FExecuted then begin 268 FCurrentMicroThread.FExecuted := True; 269 FCurrentMicroThread.FState := tsRunning; 270 FCurrentMicroThread.FExecutionStartTime := CurrentTime; 257 if FExecutedCount < FExecuteCount then begin 258 FCurrentMicroThread := FScheduler.GetNextMicroThread; 259 260 if Assigned(FCurrentMicroThread) then begin 261 Inc(FExecutedCount); 262 FCurrentMicroThread.FExecutionStartTime := NowPrecise; 263 FCurrentMicroThread.FManager := Self; 271 264 asm 272 // Restore microthread stack 273 mov ecx, Self 274 mov eax, [ecx].TMicroThreadManager.FCurrentMicroThread 275 mov edx, [eax].TMicroThread.FStackPointer 276 mov ecx, esp 277 mov esp, edx 278 push ebp // remember bp on micro thread stack for read back 279 push ecx 280 mov edx, [eax].TMicroThread.FBasePointer 281 mov ebp, edx 282 // We want to call virtual method Execute 283 // but virtual methods can be called only statically 284 // Then static method CallExecute is calling virtual method Execute 285 call TMicroThread.CallExecute 286 // end; 287 // StaticMicroThread.Execute; 288 // asm 289 pop edx 290 pop ebp 291 mov esp, edx 265 // Store FScheduler stack 266 mov eax, Self 267 mov edx, esp 268 mov [eax].TMicroThreadManager.FStackPointer, edx 269 mov edx, ebp 270 mov [eax].TMicroThreadManager.FBasePointer, edx 292 271 end; 293 //FSelected.Method(FSelected); 294 (* StaticManager := FCurrentMicroThread.FManager; 295 asm 296 // Restore FScheduler stack 297 mov eax, StaticManager // Self is invalid before BP restore 298 mov edx, [eax].TMicroThreadManager.FStackPointer 299 mov esp, edx 300 mov edx, [eax].TMicroThreadManager.FBasePointer 301 mov ebp, edx 302 end; 303 *) 304 FCurrentMicroThread.FManager := nil; 305 FCurrentMicroThread.FExecutionEndTime := CurrentTime; 306 FCurrentMicroThread.FExecutionTime := FCurrentMicroThread.FExecutionTime + 307 (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime); 308 FCurrentMicroThread.FFinished := True; 309 if FCurrentMicroThread.FFreeOnTerminate then begin 310 // Microthread is finished, remove it from queue 311 with FScheduler do 312 try 313 FMicroThreadsLock.Acquire; 314 FMicroThreads.Delete(FMicroThreads.IndexOf(FCurrentMicroThread)); 315 finally 316 FMicroThreadsLock.Release; 272 if not FCurrentMicroThread.FExecuted then begin 273 FCurrentMicroThread.FExecuted := True; 274 asm 275 // Restore microthread stack 276 mov ecx, Self 277 mov eax, [ecx].TMicroThreadManager.FCurrentMicroThread 278 mov edx, [eax].TMicroThread.FStackPointer 279 mov esp, edx 280 mov edx, [eax].TMicroThread.FBasePointer 281 mov ebp, edx 282 // We want to call virtual method Execute 283 // but virtual methods can be called only statically 284 // Then static method CallExecute is calling virtual method Execute 285 call TMicroThread.CallExecute 286 287 // Restore FScheduler stack 288 // ecx register is set by CallExecute to running micro thread 289 mov eax, [ecx].TMicroThread.FManager 290 mov edx, [eax].TMicroThreadManager.FStackPointer 291 mov esp, edx 292 mov edx, [eax].TMicroThreadManager.FBasePointer 293 mov ebp, edx 294 end; 295 296 FCurrentMicroThread.FExecutionEndTime := NowPrecise; 297 FCurrentMicroThread.FExecutionTime := FCurrentMicroThread.FExecutionTime + 298 (FCurrentMicroThread.FExecutionEndTime - FCurrentMicroThread.FExecutionStartTime); 299 FCurrentMicroThread.FFinished := True; 300 if FCurrentMicroThread.FFreeOnTerminate then begin 301 // Microthread is finished, remove it from queue 302 with FScheduler do 303 try 304 FMicroThreadsLock.Acquire; 305 FMicroThreads.Delete(FMicroThreads.IndexOf(FCurrentMicroThread)); 306 finally 307 FMicroThreadsLock.Release; 308 end; 309 end else begin 310 FCurrentMicroThread.FManager := nil; 311 FScheduler.ReleaseMicroThread(FCurrentMicroThread); 312 end; 313 //FCurrentMicroThread.FManager := nil; 314 //FScheduler.ReleaseMicroThread(FCurrentMicroThread); 315 FCurrentMicroThread := nil; 316 end else 317 //if FCurrentMicroThread.State = tsWaiting then 318 begin 319 // Execute selected thread 320 asm 321 // Restore microthread stack 322 mov ecx, Self 323 mov eax, [ecx].TMicroThreadManager.FCurrentMicroThread 324 mov edx, [eax].TMicroThread.FStackPointer 325 mov esp, edx 326 mov edx, [eax].TMicroThread.FBasePointer 327 mov ebp, edx 317 328 end; 318 329 end; 319 FCurrentMicroThread := nil;320 end else321 if FCurrentMicroThread.State = tsWaiting then begin322 // Execute selected thread323 FCurrentMicroThread.FState := tsRunning;324 FCurrentMicroThread.FExecutionStartTime := CurrentTime;325 asm326 // Restore microthread stack327 mov ecx, Self328 mov eax, [ecx].TMicroThreadManager.FCurrentMicroThread329 mov edx, [eax].TMicroThread.FStackPointer330 mov esp, edx331 mov edx, [eax].TMicroThread.FBasePointer332 mov ebp, edx333 end;334 330 end; 335 end else begin336 FCurrentMicroThread := nil;337 331 end; 338 332 end; … … 370 364 begin 371 365 inherited; 366 ExecuteTerminated := False; 372 367 Manager := TMicroThreadManager.Create; 373 368 end; … … 375 370 destructor TMicroThreadThread.Destroy; 376 371 begin 372 Terminate; 373 repeat 374 Application.ProcessMessages; 375 Sleep(1); 376 until ExecuteTerminated; 377 377 378 Manager.Free; 378 379 inherited Destroy; … … 393 394 begin 394 395 Execute; 396 asm 397 mov ecx, Self 398 end; 395 399 end; 396 400 … … 513 517 constructor TMicroThreadScheduler.Create; 514 518 begin 515 FTerminated := True; 519 FMainThreadStarter := TTimer.Create(nil); 520 FMainThreadStarter.Enabled := False; 521 FMainThreadStarter.Interval := 1; 522 FMainThreadStarter.OnTimer := MainThreadStart; 523 FMainThreadTerminated := True; 516 524 FMicroThreadsLock := TCriticalSection.Create; 517 525 FMicroThreads := TObjectList.Create; … … 521 529 FMainThreadManager := TMicroThreadManager.Create; 522 530 FMainThreadManager.FScheduler := Self; 531 UseMainThread := False; 523 532 end; 524 533 … … 526 535 begin 527 536 Active := False; 537 FMainThreadStarter.Free; 528 538 FMainThreadManager.Free; 529 539 FThreadPool.Free; … … 534 544 535 545 procedure TMicroThreadScheduler.Start; 536 var 537 Executed: Integer; 538 I: Integer; 539 begin 540 FTerminated := False; 546 begin 547 FMainThreadTerminated := False; 541 548 UpdateThreadPoolSize; 542 549 FState := ssRunning; 543 repeat544 Executed := FMainThreadManager.Execute(10);545 Application.ProcessMessages;546 if Executed = 0 then Sleep(1);547 until FState <> ssRunning;548 FTerminated := True;549 550 end; 550 551 … … 567 568 Application.ProcessMessages; 568 569 Sleep(1); 569 until F Terminated and (ThreadPoolSize = 0);570 until FMainThreadTerminated and (ThreadPoolSize = 0); 570 571 FState := ssStopped; 571 572 end; 572 573 573 574 procedure TMicroThreadScheduler.PoolThreadTerminated(Sender: TObject); 574 begin 575 var 576 ThreadIndex: Integer; 577 begin 578 TMicroThreadThread(Sender).ExecuteTerminated := True; 575 579 try 576 580 FThreadPoolLock.Acquire; 577 581 FThreadPool.OwnsObjects := False; 578 FThreadPool.Delete(FThreadPool.IndexOf(Sender)); 582 ThreadIndex := FThreadPool.IndexOf(Sender); 583 if ThreadIndex <> -1 then FThreadPool.Delete(ThreadIndex); 579 584 FThreadPool.OwnsObjects := True; 580 585 finally … … 594 599 NewThread := TMicroThreadThread.Create(True); 595 600 NewThread.Manager.FScheduler := Self; 601 NewThread.Manager.Id := FThreadPool.Count; 596 602 NewThread.OnTerminate := PoolThreadTerminated; 597 603 ThreadPool.Add(NewThread); 598 604 NewThread.Resume; 599 605 end; 600 end else 601 ThreadPool.Count := FThreadPoolSize; 606 end else begin 607 while FThreadPool.Count > FThreadPoolSize do begin 608 FThreadPool.Delete(FThreadPool.Count - 1); 609 end; 610 end; 602 611 finally 603 612 FThreadPoolLock.Release; 604 613 end; 614 end; 615 616 procedure TMicroThreadScheduler.MainThreadStart(Sender: TObject); 617 var 618 Executed: Integer; 619 begin 620 FMainThreadStarter.Enabled := False; 621 repeat 622 Executed := FMainThreadManager.Execute(1); 623 Application.ProcessMessages; 624 if Executed = 0 then Sleep(1); 625 until (FState <> ssRunning) or (not FUseMainThread); 626 FMainThreadTerminated := True; 605 627 end; 606 628 … … 619 641 FRoundRobinIndex := 0; 620 642 while (I < FMicroThreads.Count) and 621 (TMicroThread(FMicroThreads[FRoundRobinIndex]). State <> tsWaiting) do begin643 (TMicroThread(FMicroThreads[FRoundRobinIndex]).FState <> tsWaiting) do begin 622 644 // WakeUp sleeping threads 623 645 if (TMicroThread(FMicroThreads[FRoundRobinIndex]).FState = tsSleeping) and … … 634 656 if I < FMicroThreads.Count then begin 635 657 Result := TMicroThread(FMicroThreads[FRoundRobinIndex]); 658 Result.FState := tsRunning; 636 659 end; 637 660 finally 638 661 FMicroThreadsLock.Release; 662 end; 663 end; 664 665 procedure TMicroThreadScheduler.ReleaseMicroThread(MicroThread: TMicroThread); 666 begin 667 try 668 FMicroThreadsLock.Acquire; 669 if MicroThread.FState = tsRunning then begin 670 MicroThread.FState := tsWaiting; 671 end; 672 finally 673 FMicroThreadsLock.Release; 674 end; 675 end; 676 677 procedure TMicroThreadScheduler.SetUseMainThread(const AValue: Boolean); 678 begin 679 if FUseMainThread = AValue then Exit; 680 FUseMainThread := AValue; 681 if FState = ssRunning then begin 682 if AValue then FMainThreadStarter.Enabled := True; 639 683 end; 640 684 end; … … 686 730 687 731 //StaticManagers := TObjectList.Create; 688 MainScheduler := TMicroThreadScheduler.Create;732 //MainScheduler := TMicroThreadScheduler.Create; 689 733 690 734 finalization 691 735 692 MainScheduler.Free;736 //MainScheduler.Free; 693 737 //StaticManagers.Free; 694 738
Note:
See TracChangeset
for help on using the changeset viewer.