Code Monkey home page Code Monkey logo

Comments (6)

TommiPrami avatar TommiPrami commented on July 24, 2024

There is super cheap book about it :
http://www.thedelphigeek.com/2012/06/parallel-programming-with.html

-Tee-

On Tue, Mar 15, 2016 at 3:28 AM, Leonardo Herrera [email protected]
wrote:

Could somebody write a simple tutorial on how to properly execute a task
in the background, without blocking the UI? I'm not talking about parallel
executions, but how to have a procedure to be executed (and being able to
get canceled) in its own thread just for the purpose of not blocking
(completely) the UI.

Some messaging is good, but I don't want to get bogged down with the
details. The current examples are either "hello world" or some
incomprehensible, complex thing with many blocking collections, with no
example in between.

I'm struggling, badly, with this. Things get either executed many times
(even if I put "NumTasks(1)") or the program get frozen.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#67

from omnithreadlibrary.

leus avatar leus commented on July 24, 2024

Not a real answer!

Anyways, I'm writing a small tutorial on how to avoid freezing your UI using OmnithreadLibrary.

Usually, you get people asking "how can I make this portion of my code run so that the UI keeps being responsive?". The natural answer is "run threads," but threads are complicated beasts to tame when your code is highly coupled.

My own adventure ended happily, but I'm sure it's not completely safe. A nice side effect of trying to parallelize some big chunk of code is that you start seeing your past mistakes. This is huge to me.

Anyways, I even reinstalled some blogging software for this. I'll try not to get sidetracked.

from omnithreadlibrary.

gabr42 avatar gabr42 commented on July 24, 2024

There's a TON of examples in the book, in examples that come wiith the OTL and on my blog.

See here for an index: http://www.omnithreadlibrary.com/tutorials.htm

from omnithreadlibrary.

leus avatar leus commented on July 24, 2024

Primoz,

Yes, there are tons of examples, but that's also part of the issue.

I'm not complying that the work done by you is by any means bad. But it's highly technical, and why wouldn't it be? It is, after all, a very difficult field.

I have had OTL installed for years. I knew it was something else, and way better than trying to use TThread by myself. I've been subscribed to your blog for a long time, followed it thru changed (I remember you had a different blog and homepage), got the SVN distribution, you get the point.

But, let me tell you, Average Joe is not passing your first and second example. I know, because I'm Average Joe, and it took me years and many attemps before really using this in my project.

Anyways, I finally manage to have something somewhat functional. But this documentation problem is a real one, and dismissing it by waving your hand and saying "there is plenty of documentation" is not doing this project any favor. The examples are, in many cases, too abstract to grasp.

And, you know what? After I stumbled for days and got to my final solution, it was so simple! But arriving to it took me long enough.

I'll try to put my money where my mouth it. I'll be writing something for the really uninitiated and let you know.

from omnithreadlibrary.

gabr42 avatar gabr42 commented on July 24, 2024

Actually, I don't want Joe, Average to use OTL. Multithreading is a complex topic and making it simple for everybody just helps everybody to shoot itself it its collective foot. So I want an average user to do a lot of research in advance and to better understand how hard multithreading is before starting using it.

from omnithreadlibrary.

leus avatar leus commented on July 24, 2024

Fair enough. But parallel processing is not always what people needs, sometimes they just need to launch a single task in a different thread and be able to get progress reports and the ability to cancel it. I think that's the most usual use case for threads, at least in Delphi, and a good detailed tutorial on how to accomplish that may be a good thing. Anyways, I'm already working on that. I'll be asking more questions surely.

from omnithreadlibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.