什么是颤动的螺纹系统

发布于 2025-01-23 20:46:45 字数 264 浏览 3 评论 0原文

在过去的三个月中,我在Dart和Drutter中进行了编码。我在Play商店中有一个应用程序。但是我仍然不明白颤动的螺纹系统如何工作。

为了使事情变得简单,让我们采用flutter创建BasicApp时获得的最基本的计数器应用程序。

第1号问题。该基本应用中有多少个线程?
第2号问题。如果有多个线程何时创建?当它调用runapp(myApp())时?
问题3。我知道飞镖有一个孤立的概念。隔离与线程相同吗?

I have coded in dart and flutter for the past 3 months. I have one app in the play store. But I still don't understand how threading system of flutter works.

To make things simple let's take the most basic counter app that you get when you do flutter create basicapp.

Question no 1. How many threads are there in that basic app?
Question no 2. If there are multiple threads when are they created? When it calls runApp(MyApp())?
Question no 3. I know that dart has a concept of isolates. Are isolates the same as threads?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原来是傀儡 2025-01-30 20:46:45

问题1:

当应用程序开始运行时,有一个孤立/线程
我们知道是UI线程。

问题2:

通常,在大多数应用中,您对单个线程都很好。但
如果您想创建一个单独的孤立株,则可以使用
“分离。最终提供了一个链接以更好地理解。

问题3:

简单地回答,是的。

这是一个更好地理解的链接。

cheers!希望它有帮助。

Question 1:

When the application starts running, there is a single Isolate/Thread
that we know as the UI thread.

Question 2:

Generally you are good with a single thread in most applications. But
in case you want to create a separate Isolate, you can use
"Isolate.spawn". Provided a link in the end for better understanding.

Question 3:

Answering simply, Yes.

Here is a link for better understanding.

Cheers!! Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文