九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Human Task Switches Considered Harmful

When you‘re managing a team of programmers, one of the first things you have to learn to get right is task allocation. That‘s just a five-dollar word for giving people things to do. It‘s known colloquially as "file dumping" in Hebrew (because you dump files in peoples‘ laps). And how you decide which files to dump in which laps is one of the areas where you can get incredible productivity benefits if you do it right. Do it wrong, and you can create one of those gnarly situations where nobody gets anything accomplished and everybody complains that "nothing ever gets done around here."

Since this site is for programmers, I‘m going to warm up your brains a little bit with a programming problem. 

Suppose you have two separate computations to perform, A and B. Each computation requires 10 seconds of CPU time. You have one CPU which, for the sake of this problem, doesn‘t have anything else in the queue.

On our CPU, multitasking is optional. So you can either do these computations one after the other...

Sequential Processing

Computation AComputation B
1234567891011121314151617181920

... or, you can multitask. If you multitask, on this particular CPU, tasks run for 1 second at a time, and a task switch takes no time at all.

Multitasking

1234567891011121314151617181920

Which would you rather do?  Most people‘s gut reaction is that multitasking is better. In both cases, you have to wait 20 seconds to get both of your answers. But think about how long it takes to get the results to each computation.

In both cases, the results of Computation B (shown in blue) take 20 seconds to arrive. But look at Computation A. With multitasking, its results take 19 seconds to arrive... yet with sequential processing they are ready in only 10 seconds.

In other words, in this nice contrived example, the average time per computation is lower (15 seconds rather than 19.5 seconds) when you do sequential processing rather than multitasking. (Actually, it‘s not such a contrived example -- it‘s based on a real problem Jared had to solve at work).

MethodComputation A takesComputation B takesAverage
Sequential10 seconds20 seconds15
Multitasking19 seconds20 seconds19.5

Earlier I said that "a task switch takes no time at all." Actually, on real CPUs, a task switch takes a little bit of time... basically enough time to save out the state of the CPU registers and load the CPU registers for the other task. Realistically, this is as close to negligible as possible. But to make life interesting, let‘s imagine that task switches take half a second. Now things look even worse:

MethodComputation A takesComputation B takesAverage
Sequential10 seconds20 + 1 task switch =
20.5 seconds
15.25
Multitasking19 + 18 task switches =
28 seconds
20 + 19 task switches = 29.5 seconds28.75

Now ... just humor me, I know this is silly ... what if task switches take a whole minute?

MethodComputation A takesComputation B takesAverage
Sequential10 seconds20 + 1 task switch =
80 seconds
45 seconds
Multitasking19 + 18 task switches =
1099 seconds
20 + 19 task switches = 1160 secondsalmost 19 minutes!

The longer a task switch takes, the worse the multitasking penalty.

That, in and of itself, is not so earth shaking, is it? Pretty soon I‘m going to be getting irate email from morons accusing me of being "against" multitasking. "Do you want to go back to the days of DOS when you had to exit WordPerfect to run 1-2-3?" they will ask me.

But that‘s not my point. I just want you to agree with me that in this kind of example:

a) sequential processing gets you results faster on average, and

b) the longer it takes to task switch, the bigger the penalty you pay for multitasking.

OK, back to the more interesting topic of managing humans, not CPUs. The trick here is that when you manage programmers, specifically, task switches take a really, really, really long time. That‘s because programming is the kind of task where you have to keep a lot of things in your head at once. The more things you remember at once, the more productive you are at programming. A programmer coding at full throttle is keeping zillions of things in their head at once: everything from names of variables, data structures, important APIs, the names of utility functions that they wrote and call a lot, even the name of the subdirectory where they store their source code. If you send that programmer to Crete for a three week vacation, they will forget it all. The human brain seems to move it out of short-term RAM and swaps it out onto a backup tape where it takes forever to retrieve.

How long? Well, my software company recently dropped what we were doing (developing a software product codenamed CityDesk) to help a client with a bit of an emergency situation for three weeks. When we got back to the office, it seemed to take another three weeks to get back to full speed on CityDesk.

On the individual level -- have you ever noticed that you can assign one job to one person, and they‘ll do a great job, but if you assign two jobs to that person, they won‘t really get anything done? They‘ll either do one job well and neglect the other, or they‘ll do both jobs so slowly you feel like slugs have more zip. That‘s because programming tasks take so long to task switch. I feel like when I have two programming projects on my plate at once, the task switch time is something like 6 hours. In an 8-hour day, that means multitasking reduces my productivity to 2 hours per day. Pretty dismal.

As it turns out, if you give somebody two things to work on, you should be grateful if they "starve" one task and only work on one, because they‘re going to get more stuff done and finish the average task sooner. In fact, the real lesson from all this is that you should never let people work on more than one thing at once. Make sure they know what it is. Good managers see their responsibility as removing obstacles so that people can focus on one thing and really get it done. When emergencies come up, think about whether you can handle it yourself before you delegate it to a programmer who is deeply submersed in a project.

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
北師大版高一英語必修一Unit(1)Lifestyles教學(xué)案
10大最有用的時間管理技巧 你都學(xué)會了嗎?|英語閱讀|英語閱讀理解
時間應(yīng)該這樣用:10大時間管理技巧
9 Soft Skills For Success
The Elements of Cache Programming Style
激勵自己的25個簡易技巧
更多類似文章 >>
生活服務(wù)
熱點新聞
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服