进程和线程上下文切换

Clive Thompson is a longtime contributing writer for the New York Times Magazine and a columnist for Wired and now has a new book out called "Coders."

克莱夫·汤普森(Clive Thompson)是《纽约时报》(New York Times Magazine)的长期特约作家,也是《连线》(Wired)的专栏作家,现在有一本新书叫做《编码员》

"Along the way, Coders thoughtfully ponders the morality and politics of code, including its implications for civic life and the economy. Programmers shape our everyday behavior: When they make something easy to do, we do more of it. When they make it hard or impossible, we do less of it."

“一路走来,编码人员若有所思地思考代码的道德和政治问题,包括其对公民生活和经济的影响。程序员塑造了我们的日常行为:当他们使事情变得容易时,我们就会做更多。当他们使事情变得困难时,我们会做更多。甚至是不可能的事情,我们会少做些。”

I'm quoted in the book and I talk about how I've struggled with context-switching.

我在书中被引用过,并且谈论了我如何进行上下文切换。

Here is TechTarget's decent definition of Context Switching:

这是TechTarget对上下文切换的合理定义:

A context switch is a procedure that a computer's CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. Effective context switching is critical if a computer is to provide user-friendly multitasking.

上下文切换是计算机的CPU(中央处理单元)遵循的过程,以从一个任务(或进程)更改为另一个任务(或进程),同时确保任务不冲突。 如果计算机要提供用户友好的多任务处理,则有效的上下文切换至关重要。

However, human context switching is the procedure we all have to go through to switch from "I am at work" mode to "I am at home" mode. This can be really challenging for everyone, no matter their job or background, but I propose for certain personalities and certain focused jobs like programming it can be even worse.

但是,人类上下文切换是我们所有人都必须经历的过程,才能从“我在工作中”模式切换到“我在家里”模式。 对于每个人,无论他们的工作或背景如何,这都可能是真正的挑战,但我建议某些个性和某些重点工作(例如编程)会变得更糟。

Quoting Clive from an ArsTechnica article where he mentions my troubles, emphasis mine:

在ArsTechnica的文章中引用Clive的话,他提到了我的麻烦,重点是我的:

One of the things that really leapt out is the almost aesthetic delight in efficiency and optimization that you find among software developers. They really like taking something that's being done ponderously, or that's repetitive, and optimizing it. Almost all engineering has focused on making things run more efficiently. Saving labor, consolidating steps, making something easier to do, amplifying human abilities. But it also can be almost impossible to turn off. Scott Hanselman talks about coding all day long and coming down to dinner. The rest of the family is cooking dinner and he immediately starts critiquing the inefficient ways they're doing it: "I've moved into code review of dinner."

真正的突破之一是您在软件开发人员中发现的效率和优化方面的美学享受。 他们真的很喜欢采取一些艰巨或重复的工作,并对其进行优化。 几乎所有工程技术都致力于提高效率。 节省劳动力,巩固步骤,使事情变得更容易,增强了人类的能力。 但是关闭它几乎也是不可能的。 斯科特·汉瑟曼(Scott Hanselman)整天都在谈论编码,然后晚饭。 其余的家人正在做晚餐,他立即开始批评他们做饭的效率低下:“我已经进入晚餐的代码审查。”

Ordinarily a good rule of thumb on the internet is "don't read the comments." But we do. Here's a few from that ArsTechnica thread that are somewhat heartening. It sucks to "suffer" but there's a kind of camaraderie in shared suffering.

通常,互联网上的一个很好的经验法则是“不要阅读评论”。 但是我们做到了。 这是来自ArsTechnica线程的一些令人振奋的消息。 它很“痛苦”,但在共同的痛苦中却有一种友情。

With reference to "Scott Hanselman talks about coding all day long and coming down to dinner. The rest of the family is cooking dinner and he immediately starts critiquing the inefficient ways they're doing it: "I've moved into code review of dinner.""

关于“斯科特·汉塞尔曼(Scott Hanselman)整天谈论编码,然后晚饭。家庭其他成员正在做晚餐,他立即开始批评他们做事效率低下的方式:“我已经进入晚餐的代码审查。”

Wow, that rings incredibly true.

哇,真是令人难以置信。

That's good to hear. I'm not alone!

听起来还不错。 我不孤独!

I am not this person. I have never been this person.Then again, I'm more of a hack than hacker, so maybe that's why. I'm one of those people who enjoys programming, but I've never been obsessed with elegance or efficiency. Does it work? Awesome, let's move on.

我不是这个人。 我从没当过这个人,再说一次,我更像是黑客而不是黑客,所以也许这就是原因。 我是喜欢编程的人之一,但我从未被优雅或效率所困扰。 它行得通吗? 太好了,让我们继续前进。

That's amazing that you have this ability. For some it's not just hard to turn off, it's impossible and it can ruin relationships.

您拥有这种能力,真令人惊讶。 对于某些人来说,不仅要关闭它,这是不可能的,并且可能破坏关系。

When you find yourself making "TODO" and "FIXME" comments out loud, it's time to take a break. Don't ask me how I know this.

当您发现自己在大声说“ TODO”和“ FIXME”时,该休息一下了。 不要问我我怎么知道的。

It me.

是我

Yep, here too 2x--both my wife and I are always arguing over the most efficient way to drive somewhere. It's actually caused some serious arguments! And neither one of us are programmers or in that field. (Although I think each of us could have been.)From the day I was conscious I've been into bin packing and shortest path algorithms--putting all the groceries up in the freezer even though we bought too much--bin packing. Going to that grocery store and back in peak traffic--shortest path. I use these so often and find such sheer joy in them that it's ridiculous, but hey, whatever keeps me happy.

是的,在这里也是2倍-我和我妻子都一直在争论最有效的驾驶方式。 实际上引起了一些严重的争论! 我们俩都不是程序员,也不是那个领域的程序员。 (尽管我认为我们每个人都应该这样做)从我意识到这一天起,我就开始研究箱装箱和最短路径算法-将所有杂货都放进冰箱,即使我们买得太多-箱装箱。 去那家杂货店,然后返回高峰流量-最短路径。 我经常这样使用它们,并在它们中找到如此巨大的快乐,这很荒谬,但是,嘿,无论什么让我高兴。

This is definitely a thing that isn't programmer-specific. Learning to let go and to accept that your partner in life would be OK without you is an important stuff. My spouse is super competent and I'm sure could reboot the router without me and even drive from Point A to Point B without my nagging. ;)

这绝对不是特定于程序员的事情。 重要的是,学会放手并接受没有你的生活,你的伴侣是可以的。 我的配偶非常有能力,我敢肯定,如果没有我,我也可以重启路由器,甚至不用烦我就可以从A点开车到B点。 ;)

However we forget these things and we tend to try and "be helpful" and hyper-optimize things that just don't need optimizing. Let it go. Let people just butter their damn bread the way they like. Let them drive a mile out of the way, you'll still get there. We tend to be ruder to our partners than we would be to a stranger.

但是,我们忘记了这些事情,我们倾向于尝试“有所帮助”并对那些不需要优化的事情进行超优化。 放手吧。 让人们以自己喜欢的方式给该死的面包涂黄油。 让他们开一英里,您仍然可以到达那里。 我们对合作伙伴的态度往往比对陌生人的态度更鲁rud。

That’s part of the reason why I’m now making all dinners for my family ;-)

这就是我现在为家人做所有晚餐的部分原因;-)

LOL, this is also a common solution. Oh, you got opinions? Here's the spatula!

大声笑,这也是一种常见的解决方案。 哦,你有意见吗? 这是铲子!

What do YOU think? How do you context switch and turn work off and try to be present for your family?

你怎么看? 您如何上下文切换和关闭工作并尝试在家人面前出现?

翻译自: https://www.hanselman.com/blog/coders-context-switching-is-hard-for-both-computers-and-relationships

进程和线程上下文切换

进程和线程上下文切换_编码人员:上下文切换对于计算机和关系而言都很难相关推荐

  1. 查看某个进程的线程在干什么_有了多线程,为什么还要有协程?

    早期编程都是基于单进程来进行,随着计算机技术的发展,当下推出的通用操作系统都引入了线程,以便进一步提高系统的并发性,并把它视为现代操作系统的一个重要指标.既然线程可以解决高并发问题,为什么后来人们又搞 ...

  2. 开源改变世界概括_为什么任何开源社区都很难改变

    开源改变世界概括 关于Apache基金会如何一直在ApacheCon Budapest上以某种方式做事的简短演讲,由Rich Bowen撰写. 如您所知,Apache Software Foundat ...

  3. 华为平板wps语音朗读_华为隐藏的这五大功能,个个都很实用,如果你不知道,钱就白花了...

    下面为大家介绍一下,关于华为手机里面隐藏但实用的功能,看看小伙伴们有没有去注意,那就让我们一起来看看吧! 一.华为手机 1.保密柜 华为手机里面第一个比较实用的功能是保密柜,如果你不想让自己手机里面的 ...

  4. Java和线性代数的关系_高等数学,线性代数与计算机的关系?

    谢邀. 如果你从事算法方面(包括图像处理,机器学习,深度学习等),那么数学用到的地方真是多了去了.我现在从事深度学习计算机视觉方面的东西,用到的数学知识有:线性代数.矩阵论.概率论.优化方法.数值计算 ...

  5. 汉堡王什么汉堡好吃_汉堡王的食物,每一种都很好吃,看起来也很精致

    曾几何时,K记和M记,限制就是遍及每个城市的角角落落,孩子们,也都是为了能吃到一顿洋快餐,而表现得好一点.但是,人们现在越过越好,对于吃汉堡,鸡块这些,也有了更高的要求. 不断有很高大上的汉堡西餐厅开 ...

  6. Linux_多线程(进程与线程的联系_pthread库_线程创建_线程等待_线程正常终止_线程取消_线程分离_pthread_t与LWP)

    文章目录 1.线程的定义,进程和线程的关系 2.Linux下的线程 Linux原生线程库(pthread库pthread.h) 线程的优点 线程的私有数据 3.线程控制 ①创建线程(pthread_c ...

  7. 写给大忙人看的进程和线程(内附思维导图)

    我们平常说的进程和线程更多的是基于编程语言的角度来说的,那么你真的了解什么是线程和进程吗?那么我们就从操作系统的角度来了解一下什么是进程和线程. 我们平常说的进程和线程更多的是基于编程语言的角度来说的 ...

  8. 当初这么学进程和线程就好了

    我们平常说的进程和线程更多的是基于编程语言的角度来说的,那么你真的了解什么是线程和进程吗?那么我们就从操作系统的角度来了解一下什么是进程和线程. 进程 操作系统中最核心的概念就是 进程,进程是对正在运 ...

  9. 写给大忙人看的进程和线程

    来源:Java建设者 下面是本文的结构图 我们平常说的进程和线程更多的是基于编程语言的角度来说的,那么你真的了解什么是线程和进程吗?那么我们就从操作系统的角度来了解一下什么是进程和线程. 进程 操作系 ...

最新文章

  1. 基础算法整理(1)——递归与递推
  2. 深度分析蔡徐坤的百万流量数据,揭底哪些是假的!
  3. 什么是Terraform?
  4. Linux网络配置:设置IP地址、网关DNS、主机名
  5. [转载] Python京东抢购
  6. leetcode刷题:121题stock
  7. 为什么你写作赚不到钱?
  8. 语言栈十进制转十六进制_十进制数转二进制、八进制、十六进制等任意进制_C语言「抄作业」...
  9. 如何把博客园的博客弄出狂拽酷炫的效果
  10. Attempt to do update or delete on table educator.t_item_info that does not use an AcidOutputFormat o
  11. 性能测试 性能测试流程(一) 性能测试步骤是什么?性能测试常规流程说明
  12. CentOS8下安装wget、wget2
  13. WiFi基础知识讲解
  14. 论文笔记 Weakly Supervised Deep Detection Networks - CVPR 2016
  15. 范寶興:3分法、4分法在12階穿越界面的浪漫
  16. NPN型三极管的工作原理
  17. 绝望而沉重的爱·《致我们终将逝去的青春》
  18. 排名第一的亚马逊关键词工具
  19. 【LeetCode】三维型体的投影面积和表面积
  20. 【verbs】ibv_create_comp_channel()

热门文章

  1. 学习笔记——Dialog回调
  2. 庞加莱 (Jules Henri Poincaré)
  3. Python网络编程-一文厘清socket、TCP和UDP那点事
  4. IE8下indexOf兼容方法
  5. 人工智能导论课程论文:人工智能及其发展趋势
  6. unity 让ui对齐_Unity中UI锚点的四种摆放形式
  7. SAP IDOC和EDI应用(1) 基本原理介绍及实例操作
  8. 跟尤雨溪一起解读Vue3源码笔记- Vue Mastery
  9. python量化实战_Python量化交易实战
  10. 临床医学中计算机的应用,临床医学中计算机图像处理技术的应用