TaskDisplayArea、ActivityStack、Task以及ActivityRecord之间的关系

目录

一、TaskDisplayArea、ActivityStack、TaskRecord以及ActivityRecord关系图

二、TaskDisplayArea、ActivityStack、Task以及ActivityRecord相关代码

1、ActivityRecord

2、Task

3、ActivityStack

4、TaskDisplayArea


前言:对TaskDisplayArea、ActivityStack、TaskRecord以及ActivityRecord这几个类,搞应用开发的同学可能会觉得既熟悉又陌生,有接触但是对他们之间具体的关系只是一知半解,所以我这里整理了一下,方便自己回顾以及同学们的学习。以下基于Android 11讲解,不同Android版本会有差异。

一、TaskDisplayArea、ActivityStack、TaskRecord以及ActivityRecord关系图

先通过框架图直观的画出他们的关系:

我们使用dumpsys activity activities命令查看 activity 相关信息:
 

ACTIVITY MANAGER ACTIVITIES (dumpsys activity activities)
Display #0 (activities from top to bottom): //(1)Stack #33: type=standard mode=fullscreen  //(2)isSleeping=falsemBounds=Rect(0, 0 - 0, 0)mResumedActivity: ActivityRecord{42c5293 u0 com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity t33}* Task{abc62c9 #33 visible=true type=standard mode=fullscreen //(3)
translucent=false A=10045:com.google.android.youtube.tv.main U=0 StackId=33 sz=1}mBounds=Rect(0, 0 - 0, 0)mMinWidth=-1 mMinHeight=-1userId=0 effectiveUid=u0a45 mCallingUid=u0a45 mUserSetupComplete=true mCallingPackage=com.google.android.youtube.tv mCallingFeatureId=nullaffinity=10045:com.google.android.youtube.tv.mainintent={act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] flg=0x15000000 pkg=com.google.android.youtube.tv cmp=com.google.android.yout
ube.tv/com.google.android.apps.youtube.tv.activity.MainActivity}mActivityComponent=com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivityautoRemoveRecents=false isPersistable=true activityType=1rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLEActivities=[ActivityRecord{42c5293 u0 com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity t33}]askedCompatMode=false inRecents=true isAvailable=truemRootProcess=ProcessRecord{3b66003 2276:com.google.android.youtube.tv/u0a45}taskId=33 stackId=33mHasBeenVisible=truemResizeMode=RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION mSupportsPictureInPicture=false isResizeable=truelastActiveTime=936386 (inactive for 56s)* Hist #0: ActivityRecord{42c5293 u0 com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity t33}packageName=com.google.android.youtube.tv processName=com.google.android.youtube.tvlaunchedFromUid=10045 launchedFromPackage=com.google.android.youtube.tv launchedFromFeature=null userId=0app=ProcessRecord{3b66003 2276:com.google.android.youtube.tv/u0a45}Intent { act=android.intent.action.MAIN cat=[android.intent.category.LEANBACK_LAUNCHER] flg=0x15000000 pkg=com.google.android.youtube.tv cmp=com.google.android
.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity bnds=[1536,405][1744,554] }rootOfTask=true task=Task{abc62c9 #33 visible=true type=standard mode=fullscreen translucent=false A=10045:com.google.android.youtube.tv.main U=0 StackId=33 sz
=1}taskAffinity=10045:com.google.android.youtube.tv.mainmActivityComponent=com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivitybaseDir=/product/app/YouTubeLeanback/YouTubeLeanback.apkdataDir=/data/user/0/com.google.android.youtube.tvstateNotNeeded=false componentSpecified=false mActivityType=standardcompat={320dpi always-compat} labelRes=0x7f12002d icon=0x7f0f0000 theme=0x7f1300demLastReportedConfigurations:mGlobalConfig={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1920
, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0
} s.6}mOverrideConfig={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 19
20, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATION_
0} s.2}CurrentConfiguration={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 -1920, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=standard mAlwaysOnTop=undefined mRotation=ROTATI
ON_0} s.2}taskDescription: label="null" icon=null iconResource=/0 iconFilename=null primaryColor=ff282828backgroundColor=ff303030 statusBarColor=ff000000 navigationBarColor=ff000000launchFailed=false launchCount=1 lastLaunchTime=-56s888msmHaveState=false mIcicle=nullstate=RESUMED stopped=false delayedResume=false finishing=falsekeysPaused=false inHistory=true setToSleep=false idle=true mStartingWindowState=STARTING_WINDOW_SHOWNoccludesParent=true noDisplay=false immersive=false launchMode=2frozenBeforeDestroy=false forceNewConfig=falsemActivityType=standardwindows=[Window{287fb2e u0 com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity}, Window{694a88e u0 com.google.android.youtub
e.tv/com.google.android.apps.youtube.tv.activity.MainActivity}]windowType=2 hasVisible=truemOccludesParent=true mOrientation=6mVisibleRequested=true mVisible=true mClientVisible=true reportedDrawn=true reportedVisible=truemNumInterestingWindows=2 mNumDrawnWindows=2 allDrawn=true lastAllDrawn=true)startingData=null firstWindowDrawn=true mIsExiting=falsenowVisible=true lastVisibleTime=-56s184msresizeMode=RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSIONmLastReportedMultiWindowMode=false mLastReportedPictureInPictureMode=falseStack #1: type=home mode=fullscreen                                  //(4)isSleeping=falsemBounds=Rect(0, 0 - 0, 0)mLastPausedActivity: ActivityRecord{5965cc0 u0 com.google.android.tvlauncher/.MainActivity t30}* Task{3d3a13e #30 visible=false type=home mode=fullscreen         //(5)
translucent=true A=10036:.TvLauncher U=0 StackId=1 sz=1}mBounds=Rect(0, 0 - 0, 0)mMinWidth=-1 mMinHeight=-1userId=0 effectiveUid=u0a36 mCallingUid=0 mUserSetupComplete=true mCallingPackage=null mCallingFeatureId=nullaffinity=10036:.TvLauncherintent={act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800100 cmp=com.google.android.tvlauncher/.MainActivity}mActivityComponent=com.google.android.tvlauncher/.MainActivityautoRemoveRecents=false isPersistable=false activityType=2rootWasReset=false mNeverRelinquishIdentity=true mReuseTask=false mLockTaskAuth=LOCK_TASK_AUTH_PINNABLEActivities=[ActivityRecord{5965cc0 u0 com.google.android.tvlauncher/.MainActivity t30}]askedCompatMode=false inRecents=true isAvailable=truetaskId=30 stackId=1mHasBeenVisible=truemResizeMode=RESIZE_MODE_UNRESIZEABLE mSupportsPictureInPicture=false isResizeable=falselastActiveTime=931857 (inactive for 61s)* Hist #0: ActivityRecord{5965cc0 u0 com.google.android.tvlauncher/.MainActivity t30}packageName=com.google.android.tvlauncher processName=com.google.android.tvlauncherlaunchedFromUid=0 launchedFromPackage=null launchedFromFeature=null userId=0app=ProcessRecord{14710bd 1297:com.google.android.tvlauncher/u0a36}Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10800100 cmp=com.google.android.tvlauncher/.MainActivity (has extras) }       rootOfTask=true task=Task{3d3a13e #30 visible=false type=home mode=fullscreen translucent=true A=10036:.TvLauncher U=0 StackId=1 sz=1}taskAffinity=10036:.TvLaunchermActivityComponent=com.google.android.tvlauncher/.MainActivitybaseDir=/product/priv-app/TVLauncher/TVLauncher.apkdataDir=/data/user/0/com.google.android.tvlauncherstateNotNeeded=true componentSpecified=false mActivityType=homecompat={320dpi always-compat} labelRes=0x7f12002b icon=0x7f0f0000 theme=0x7f130007mLastReportedConfigurations:mGlobalConfig={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 1920
, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=home mAlwaysOnTop=undefined mRotation=ROTATION_0} s.8
}mOverrideConfig={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 - 19
20, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=home mAlwaysOnTop=undefined mRotation=ROTATION_0} s
.3}CurrentConfiguration={1.0 ?mcc?mnc [en_US] ldltr sw540dp w960dp h540dp 320dpi lrg long land television finger qwerty/v/v dpad/v winConfig={ mBounds=Rect(0, 0 -1920, 1080) mAppBounds=Rect(0, 0 - 1920, 1080) mWindowingMode=fullscreen mDisplayWindowingMode=fullscreen mActivityType=home mAlwaysOnTop=undefined mRotation=ROTATION_0
} s.4}RequestedOverrideConfiguration={0.0 ?mcc?mnc ?localeList ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?ldr ?wideColorGamut ?orien ?uimode ?night ?touch ?ke
yb/?/? ?nav/? winConfig={ mBounds=Rect(0, 0 - 0, 0) mAppBounds=null mWindowingMode=undefined mDisplayWindowingMode=undefined mActivityType=home mAlwaysOnTop=undefined mR
otation=undefined}}taskDescription: label="null" icon=null iconResource=/0 iconFilename=null primaryColor=ff37474fbackgroundColor=ff303030 statusBarColor=ff263238 navigationBarColor=ff000000launchFailed=false launchCount=0 lastLaunchTime=-16m8s532msmHaveState=true mIcicle=Bundle[mParcelledData.dataSize=1272]state=STOPPED stopped=true delayedResume=false finishing=falsekeysPaused=false inHistory=true setToSleep=false idle=true mStartingWindowState=STARTING_WINDOW_REMOVEDoccludesParent=true noDisplay=false immersive=false launchMode=2frozenBeforeDestroy=false forceNewConfig=falsemActivityType=homewindows=[Window{eccb3b1 u0 com.google.android.tvlauncher/com.google.android.tvlauncher.MainActivity}]windowType=2 hasVisible=truemOccludesParent=true mOrientation=0mVisibleRequested=false mVisible=false mClientVisible=false reportedDrawn=false reportedVisible=falsemAppStopped=truemNumInterestingWindows=1 mNumDrawnWindows=1 allDrawn=true lastAllDrawn=true)startingData=null firstWindowDrawn=true mIsExiting=falsenowVisible=false lastVisibleTime=-7m58s405msresizeMode=RESIZE_MODE_UNRESIZEABLEmLastReportedMultiWindowMode=false mLastReportedPictureInPictureMode=false

根据以上显示的信息,注释(1)中的Display #0 为ActivityDisplay,id为0,注释(2)中的Stack #33 为 ActivityStack,id为33,注释(4)中的Stack #1为ActivityStack,id为1,注释(3)和注释(5)TaskRecord的 id分别为33和30.

 关系图如下:

二、TaskDisplayArea、ActivityStack、Task以及ActivityRecord相关代码

1、ActivityRecord

\frameworks\base\services\core\java\com\android\server\wm\ActivityRecord.java


final class ActivityRecord {...............final ActivityRecord.Token appToken;final ActivityTaskManagerService mAtmService;final ComponentName realActivity;  // the intent component, or target of an alias.final String shortComponentName; // the short component name of the intentfinal String packageName; // the package implementing intent's componentfinal String processName; // process where this component wants to runfinal String taskAffinity; // as per ActivityInfo.taskAffinityboolean fullscreen; // covers the full screen?...............
}

ActivityRecord记录着Activity的信息,与Activity一一对应,可能大家对ActivityRecord与Activity搞不太清楚,实际上ActivityRecord就是Activity对应的服务端,Activity为客户端。

2、Task

\frameworks\base\services\core\java\com\android\server\wm\Task.java

class Task extends WindowContainer<WindowContainer> {
................final ActivityTaskManagerService mAtmService;final ActivityStackSupervisor mStackSupervisor;final RootWindowContainer mRootWindowContainer;/* Unique identifier for this task. */final int mTaskId;/* User for which this task was created. */// TODO: Make finalint mUserId;
................
}

3、ActivityStack

\frameworks\base\services\core\java\com\android\server\wm\ActivityStack.java

class ActivityStack extends Task {
}

 我们可以看到,在Android 11中ActivityStack是继承于task的,因此持有相对应Task中的mAtmService、mStackSupervisor、mRootWindowContainer、mTaskId等变量。通常开启一个新的应用,就会新建一个ActivityStack。但在同一个应用中如果通过singleInstance启动activity,那么也会新建一个ActivityStack。

4、TaskDisplayArea

\frameworks\base\services\core\java\com\android\server\wm\TaskDisplayArea.java

 final class TaskDisplayArea extends DisplayArea<ActivityStack> {.....................// Cached reference to some special tasks we tend to get a lot so we don't need to loop// through the list to find them.private ActivityStack mRootHomeTask;private ActivityStack mRootPinnedTask;private ActivityStack mRootSplitScreenPrimaryTask;// TODO(b/159029784): Remove when getStack() behavior is cleaned-upprivate ActivityStack mRootRecentsTask;.....................
}

 我们可以看到这里有很多个ActivityStack 的全局变量,mRootHomeTask使用来存储launcher的ActivityStack,其type为home。

\frameworks\base\services\core\java\com\android\server\wm\TaskDisplayArea.java

 ActivityStack getStack(int windowingMode, int activityType) {
.........if (activityType == ACTIVITY_TYPE_HOME) { //(6)return mRootHomeTask;} else if (activityType == ACTIVITY_TYPE_RECENTS) {return mRootRecentsTask;}
.........
}
 public static String activityTypeToString(@ActivityType int applicationType) {switch (applicationType) {case ACTIVITY_TYPE_UNDEFINED: return "undefined";case ACTIVITY_TYPE_STANDARD: return "standard";case ACTIVITY_TYPE_HOME: return "home";  //(7)case ACTIVITY_TYPE_RECENTS: return "recents";case ACTIVITY_TYPE_ASSISTANT: return "assistant";case ACTIVITY_TYPE_DREAM: return "dream";}return String.valueOf(applicationType);}

以上代码我们可以看到通过TaskDisplayArea获取ACTIVITY_TYPE_HOME的时候即返回mRootHomeTask,在注释(7)这里看到其实际type为字符“home”,那么我们回过头看看dumpsys activity activities中launcher相关信息:

 Stack #1: type=home mode=fullscreen                                  //(8)isSleeping=falsemBounds=Rect(0, 0 - 0, 0)mLastPausedActivity: ActivityRecord{5965cc0 u0 com.google.android.tvlauncher/.MainActivity t30}* Task{3d3a13e #30 visible=false type=home mode=fullscreen         
translucent=true A=10036:.TvLauncher U=0 StackId=1 sz=1}mBounds=Rect(0, 0 - 0, 0)mMinWidth=-1 mMinHeight=-1userId=0 effectiveUid=u0a36 mCallingUid=0 mUserSetupComplete=true mCallingPackage=null mCallingFeatureId=nullaffinity=10036:.TvLauncherintent={act=android.intent.action.MAIN cat=[android.intent.category.HOME]

在注释(8)中我们看到其type为home。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/40575.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

go语言day08 泛型 自定义错误处理 go:协程

泛型&#xff1a; 抛错误异常 实现error接口类型 用java语言解释的话&#xff0c;实现类需要重写error类型的抽象方法Error().这样就可以自定义异常处理。 回到go语言&#xff0c;在Error()方法中用*argError 这样一个指针类来充当error接口的实现类。 在f2()方法中定义返回值…

CONFIG_FEATURE_MOUNT_NFS

CONFIG_FEATURE_MOUNT_NFS是一个Linux内核配置选项&#xff0c;它允许系统支持挂载NFS文件系统。如果您在编译内核或构建根文件系统时遇到关于NFS支持的问题&#xff0c;您可能需要检查这个配置选项是否被启用。在某些情况下&#xff0c;例如使用BusyBox作为工具集时&#xff0…

漏洞分析|OpenSSH漏洞(CVE-2024-6387)

一、网传漏洞POC信息 漏洞编号&#xff1a;CVE-2024-6387 漏洞名称&#xff1a;OpenSSH regreSSHion 漏洞 POC上传者&#xff08;作者不确定&#xff09;&#xff1a;7etsuo 发布日期&#xff1a;2024-07-01 漏洞类型&#xff1a;远程代码执行&#xff08;RCE&#xff09;…

昇思MindSpore学习笔记3-03热门LLM及其他AI应用--基于MobileNetv2的垃圾分类

摘要&#xff1a; MindSpore AI框架使用MobileNetv2模型开发垃圾分检代码。检测本地图像中的垃圾物体&#xff0c;保存检测结果到文件。记录了开发过程和步骤&#xff0c;包括环境准备、数据下载、加载和预处理、模型搭建、训练、测试、推理应用等。 1、实验目的 了解垃圾分…

解决pip默认安装位置在C盘方法

新版python中使用pip命令将opencv库安装到base环境中 首先我们打开命令控制窗口&#xff0c;激活base环境&#xff0c;输入conda activate base 然后检查一下自己base环境中是否安装opencv库&#xff0c;输入conda list 往下找&#xff0c;找到o开头的地方&#xff0c;发现是…

达梦数据库 页大小与数据库字段长度的关系

对于达梦数据库实例而言&#xff0c;页大小 (page_size)、簇大小 (extent_size)、大小写敏感 (case_sensitive)、字符集 (charset) 这四个参数&#xff0c;一旦确定无法修改&#xff1b;如果过程中发现这些数据设置的不对&#xff0c;只能是重新新建数据库实例&#xff0c;而不…

GraphQL与RESTful API的区别和优势

GraphQL GraphQL是一种用于API设计的语言和查询协议&#xff0c;由Facebook于2015年推出。它允许客户端向服务器指定他们需要的数据字段&#xff0c;而不是像RESTful API那样请求整个资源然后过滤数据。在GraphQL中&#xff0c;客户端发送一个单一的请求&#xff0c;而服务器返…

通过npm安装OpenLayers库,vue3+ts环境下OpenLayers实现加载本地高德离线地图并添加标记点、标记点气泡及标记点气泡按钮事件

在Vue 3和TypeScript的环境下使用OpenLayers来加载高德地图的离线瓦片&#xff0c;并添加标记点、标记点气泡以及处理气泡上的按钮事件&#xff0c;涉及到几个步骤。首先&#xff0c;需要明确高德地图的瓦片数据格式和如何配置OpenLayers以使用这些瓦片。接着&#xff0c;我们需…

零信任沙箱是什么?零信任沙箱有什么作用?

零信任沙箱是什么&#xff1f;零信任沙箱有什么作用&#xff1f; 在当今数字化时代&#xff0c;数据安全已成为各行各业的核心关注点。零信任沙箱作为一种新兴的安全技术&#xff0c;不仅适用于政府和金融等关键领域&#xff0c;其实用性覆盖了更广泛的场景&#xff0c;如医疗…

数智化配补调:零售品牌增长新引擎

随着科技的不断进步和消费者需求的日益个性化、多元化&#xff0c;传统服装行业正面临着前所未有的挑战与机遇。在这个快速变化的时代&#xff0c;如何精准把握市场脉搏&#xff0c;实现库存的高效管理&#xff0c;成为了服装品牌生存与发展的关键。数智化配补调策略应运而生&a…

mysql定时备份数据库

文章目录 核心目标思路具体方法一、编写脚本二、修改文件属性三、找一个mysqldump文件四、把.sh放到定时器里 其它&#xff1a;windows的脚本 核心目标 解决数据库定时备份的工作。centos环境。 思路 用centos的crontab定时执行脚本。 具体方法 一、编写脚本 编写backup_…

精准控制:Eureka服务续约间隔配置全指南

精准控制&#xff1a;Eureka服务续约间隔配置全指南 在微服务架构中&#xff0c;服务的发现与注册是确保服务间有效通信的关键。Eureka&#xff0c;作为Netflix开源的服务发现框架&#xff0c;提供了一种优雅的方式来实现服务的注册与发现。然而&#xff0c;服务续约间隔的配置…

vue单独部署到宝塔教程

配置反向代理 注意:如果目标网站是https则写https否则写http 2.关于解决部署后无法刷新,直接报错404 location / { try_files $uri $uri/ /index.html; }

程序员鱼皮的保姆级写简历指南第三弹,简历常见问题和建议汇总

大家好&#xff0c;我是程序员鱼皮。做知识分享这些年来&#xff0c;我看过太多简历、也帮忙修改过很多的简历&#xff0c;发现很多同学是完全不会写简历的、会犯很多常见的问题&#xff0c;不能把自己的优势充分展示出来&#xff0c;导致错失了很多面试机会&#xff0c;实在是…

PostgreSQL LIMIT 子句

PostgreSQL LIMIT 子句 PostgreSQL 是一种功能强大的开源对象关系数据库管理系统&#xff0c;广泛用于各种应用中。在处理大量数据时&#xff0c;我们通常只需要检索部分记录&#xff0c;而不是整个数据集。这时&#xff0c;LIMIT 子句就变得非常有用。本文将详细介绍 Postgre…

代码随想录Day74(图论Part10)

94. 城市间货物运输| &#xff08;Bellman_ford队列优化版 / SPFA&#xff09; 题目&#xff1a;94. 城市间货物运输 I (kamacoder.com) 思路&#xff1a; Bellman_ford 算法 每次都是对所有边进行松弛&#xff0c;其实是多做了一些无用功。 只需要对 上一次松弛的时候更新过的…

p6spy 组件打印完整的 SQL 语句、执行耗时

一、前言 我们来配置一下 Mybatis Plus 打印 SQL 功能&#xff08;包括执行耗时&#xff09;&#xff0c;一方面可以了解到每个操作都具体执行的什么 SQL 语句&#xff0c; 另一方面通过打印执行耗时&#xff0c;也可以提前发现一些慢 SQL&#xff0c;提前做好优化&#xff0c…

layui中添加上下文提示弹窗

<p context-tip"自定义上下文提示信息">段落内容...</p> <div context-tip"自定义上下文提示信息">div内容...</div>// 悬浮提示 $("body").on("mouseenter", "*[context-tip]", function () {v…

操作系统僵尸进程、CFS、上下文切换

进程 Linux的进程调度 CFS 完全公平调度算法 权重和nice值 权重&#xff1a;权重越大&#xff0c;分配的时间比例越大&#xff0c;就相当于进程的优先级越高。 进程的时间 C P U 总时间 ∗ 进程的权重 / 就绪队列所有进程权重之和 进程的时间 CPU总时间 * 进程的权重/就绪…

电脑鼠标一直转圈圈怎么处理?对症下药,分享6种方法

在使用电脑的过程中&#xff0c;鼠标一直转圈圈是一个常见且令人困扰的问题。这种情况通常意味着系统正在处理某些任务&#xff0c;但如果持续时间过长&#xff0c;可能表明系统存在性能问题或错误。本文将详细探讨鼠标一直转圈圈的常见原因及其解决方法。 摘要 电脑鼠标一直转…