Jump to content
aehimself

Cross-platform solution to forcefully end a thread

Recommended Posts

With all the respect to professor and so on, marking threads the absolute evil rather looks like being unable to use them right.

There's no other means of doing several things at one time. All the async sugar is implemented via threads under-the-hood. Processes? Highly similar to threads.
Some languages strive to hide this mechanism from a programmer, just like Go and JS. But they use threads internally anyway.

I suspect pr. Lee doesn't suggest any acceptable alternative?

Share this post


Link to post
On 11/15/2019 at 7:00 PM, Joseph MItzen said:
Quote

If the next generation of programmers makes more intensive use of multithreading, then the next generation of computers will become nearly unusable.

-Edward A. Lee, "The Problem With Threads"

 

All I can say to Professor Lee is good luck with creating any non trivial mobile application without using threads that will not be killed by the OS for not responding or performing network operations on main thread.

 

Theory is one thing practice another.

  • Like 2

Share this post


Link to post

Our servers rarely run with less than 25 concurrent threads. 

We also have threads that can't run in parallel and a scheduler in place that ensures that it doesn't happen.

 

Have we had problems? Sure, when we broke the rules.

 

Threads are not more dangerous or hard to use than any other field of development you are introduced to.

The hardest thing about multithreading is to adapt your thinking to asynchronous events, instead of sequences.

  • Like 1

Share this post


Link to post

Professor Lee is an amazing academic simply because he proves the difference between academia and practice. We need both sides though.

 

Out of curiosity, does the comment in SQLite site implies that they do not use threads internally in the database?

Share this post


Link to post

I wonder what SQLite guys suggest to use instead of threads. Maybe they'll say "Use DB queries in the very main thread, and if you have queries lasting longer than 200 ms, do not use DB"? 😄

Share this post


Link to post
35 minutes ago, John Kouraklis said:

Out of curiosity, does the comment in SQLite site implies that they do not use threads internally in the database?

The existence of sqlite3_interrupt suggests that yes indeed, they do 🙂

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×