Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

code-delphi-async

Code examples from Delphi Event-based and Asynchronous Programming Book

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Code examples from Delphi Event-based and Asynchronous Programming Book

[https://dalija.prasnikar.info/delphiebap/](https://dalija.prasnikar.info/delphiebap/)

[https://dalija.prasnikar.info](https://dalija.prasnikar.info)

Part 1. The Loop

Chapter 1. Hidden complexity

  • ConHelloWorld.dpr
  • HelloWorld.dpr

Chapter 2. Peeking at the console

  • ConSumParams.dpr
  • ConSumRead.dpr
  • ConSumLoop.dpr

Part 2. Messaging Systems

Chapter 7. Windows Messaging System

    1. Windows Message Queue
      • WinApp.dpr

Chapter 8. Windows Messaging System in VCL

    1. Window for non-visual components
      • GearApp.dpr
      • GearU.pas
      • GearMainF.pas
      • GearMainF.dfm

Chapter 10. System.Messaging

  • MsgApp.dpr
  • MsgMainF.pas
  • MsgMainF.dfm

Part 3. Life, the Universe, and Everything

Chapter 12. Automatic memory management and Chapter 14. Class helpers

  • XMLBuilderApp.dpr
  • XMLBuilderU.pas
  • XMLBuilderMainF.pas
  • XMLBuilderMainF.dfm
  • XMLBuilderIntfU.pas

Chapter 13.6 Interfaces and generics

  • GenIntf.dpr

Chapter 15. Anonymous methods and lambdas

    1. Anonymous method variable capture
      • AnonymousVar.dpr
      • AnonymousVarProc.dpr
      • AnonymousVarProc2.dpr
      • Anonymous1.dpr
      • Anonymous2.dpr
      • Anonymous3.dpr
      • Anonymous4.dpr
      • Anonymous5.dpr
      • Anonymous6.dpr
      • Anonymous7.dpr
      • Anonymous8.dpr
    1. Capturing and loops
      • CaptureLoops.dpr
      • CaptureLoopsCorrect.dpr
      • CaptureLoopsObject.dpr
    1. Anonymous method reference cycles
      • Cycle1.dpr
      • Cycle2.dpr
      • Cycle3.dpr
      • Cycle4.dpr
    1. Using weak references to break anonymous method reference cycles
      • CycleWeak.dpr

Part 4. Asynchronous Programming and Multithreading

Chapter 16. Asynchronous programming and multithreading

  • SynchronousApp.dpr
  • SynchronousMainF.pas
  • SynchronousMainF.dfm

Chapter 19. Application.ProcessMessages reentrancy problem

  • ProcessMsgApp.dpr
  • ProcessMsgMainF.pas
  • ProcessMsgMainF.dfm

Chapter 20. Moving long operations to a background thread

  • BackgroundApp.dpr
  • BackgroundMainF.pas
  • BackgroundMainF.dfm

Chapter 21. Asynchronous message dialog

  • AsyncDlg.dpr
  • AsyncDlg.dproj
  • AsyncDlgMainF.pas
  • AsyncDlgMainF.fmx

Chapter 22. Tasks

  • TasksApp.dpr
  • TasksMainF.pas
  • TasksMainF.dpr

Chapter 23. Back to the Future

  • FutureApp.dpr
  • FutureMainF.pas
  • FutureMainF.dfm

Chapter 24. There is no Future like your own Future

    1. Generic approach to future
      • GenFutureApp.dpr
      • GenFutureMainF.pas
      • GenFutureMainF.dfm
      • NX.Core.pas
      • NX.GenFuture.pas
    1. TValue approach to future
      • ValueFutureApp.dpr
      • ValueFutureMainF.pas
      • ValueFutureMainF.dfm
      • NX.Future.pas

Part 5. Thread Safety

Chapter 25. What is thread safety anyway?

    1. Working example of thread-unsafe code
      • ThreadUnsafe.dpr

Chapter 29. Use immutable data

  • Mutability.dpr

Chapter 31. Initialization pattern

  • InitializationPattern.pas

Chapter 32. Protecting shared data

    1. Synchronization primitives (objects)
      • UsingSyncObjs.pas
      • DeadlockApp.dpr
      • DeadlockMainF.pas
      • DeadlockMainF.dfm
    1. Thread synchronization
      • ThreadSyncApp.dpr
      • ThreadSyncMainF.pas
      • ThreadSyncMainF.dfm
    1. Events
      • EventsApp.dpr
      • EventsMainF.pas
      • EventsMainF.dfm

Part 6. GUI and Multithreading

Chapter 34. Communicating with the main thread

  • GUICommApp.dpr
  • GUICommMainF.pas
  • GUICommMainF.dfm
  • ProgressF.pas
  • ProgressF.dfm
  • ControlsF.pas
  • ControlsF.dfm
  • SpeedF.pas
  • SpeedF.dfm
  • MessagingF.pas
  • MessagingF.dfm

Chapter 35. Communication and GUI issues

    1. Deadlocking the main thread
      • GUIDeadlockApp.dpr
      • GUIDeadlockMainF.pas
      • GUIDeadlockMainF.dfm
    1. Cleanup on GUI destruction
      • GUICleanupApp.dpr
      • GUICleanupMainF.pas
      • GUICleanupMainF.dfm
      • DestroyF.pas
      • DestroyF.dfm
      • GuardianF.pas
      • GuardianF.dfm
      • WaitF.pas
      • WaitF.dfm