来 这个是盘子OK这又剪刀了好 您好早晨好 現在是週二CSE-421 第四季禮拜年這是我們開始的我們開始的我們先說一下今天我會介紹最重要的一個就是這個這幾個月,雖然我不知道,但是在選擇的選擇之間,我們就想決定誰是你最愛的兒子他們都很特別,但我覺得這是一個很好的地方我們會談談過的程序我們會談談如何保護保護的程序在內的程序我們會談談內容保護的程序然後我會用一堆例如,我會展示你如何找出同樣的資訊在自己的機器用一些普通的雲溢修以及一些例如如何處理的程序在其中一個程序裏我們想談談幾個程序首先,我們會談談如果你是不接收電郵在CSE421CSE421的單位把你的手提高我知道,有幾個你應該把你的手提高如果你想接收電郵我們會用這個單位如果你的手提高如果你想把電郵把電郵把你手提高全部的電郵把電郵給你送給自己如果你是不接收電郵我們會用這個單位把電郵把電郵把電郵把電郵把電郵把電郵把電郵把電郵把電郵 New YorkLet me start off with the mayor's call, soLet me see if this is going to work todayIt would be good if I let you inThis is my faultand I appreciate people who came here to takea preterm examI know some of you guys sat around for a whilepulling your jets at 9am or Friday morningwhich is not the kind of thing I like to dobut I really appreciate those who cameI took the exam and feedback is going to be really helpful for us in designing how we do the rest of the class.So thank you and again, my apologies for the mix up.I can promise you that this kind of thing will not happen on the big storm or the final.This is a good chance for me to have some practice and get an exam.All right, so let me do some announcements before I get started.Just make sure these don't fall off the end of Q&A.So we have a mail in this.Like I said, if you're registered for the class, you should be on the mail, right?And we will keep this low traffic.This is just for really course related announcements.It's important for people to have.If you need to contact the course staff, please email staff at mail.cse421.net.That comes to me and the other TAs, and it'll help make sure that you get a fast response.I tend to get, well, I wouldn't say I get a lot of email.I'm just not good with the email I get, so it feels like a lot of email.So if you send email directly to me, it will probably not be answered before.It would have been had you set it to the staff email list.Because there's three, perhaps four of the people that are on that list that will on some level have access to the same state that I want.All right, we have a web server that's up.If you're curious, you can go to the web server page.There's nothing up there yet.We're working on it.Hopefully today we'll have some content, including assignment zero.So we're working really hard to get assignment zero out.The goals have it out by the end of the day today, so you guys can get started half.Probably if it comes out today, we'll be making changes to it and updating you guys as things go along.So download it, take a look at it, set up your virtual machine,but be on the lookout from now so that it's about things that there's bugs.We are going to start the recitations for this class next week.So not this week.This week there will be no recitations.Next week we will start the recitations.Let me do a quick and useful pull about timing for recitations in office hours.So I noticed one of the recitations is scheduled at 8am.Is anybody signed up for that recitation?You guys like to go to a different recitation that is not at 8am?Yeah, but my schedule probably won't allow us.So why don't we do this over the course list?If we can get you guys into another recitation, then we may try to kill off the 8am recitation.That seems pretty brutal.What about the time?What's that?Do you know the other time?Yeah, but I think there's sprinkled throughout the week.So there's one at, I think at 4pm it's another 10am, so we will see.If you can't make it to another one, then we will do one at 8am.And then finally, TA is going to hold office hours for this class.Now, the interesting thing is, this class is at 9am.And since all of you guys have been getting up every morning to come to class,I was wondering if there would be any interest in having office hours after class.I know that that's a time that interferes with other classes you might be taking,but I figure as long as we're dragging you out of bed at 9am,we might as well speak in the pot a little bit about having the TAs aroundmaybe one or two days a week after class to answer questions on the assignment.Is there any interest in this?If you're interested in this razor here,because I think that's a good carrot for people who come to class.Now,however,there's one caveat.If you go to office hours and you did not come to lecture,we will somehow figure out who you are,and we will make sure that you pay.So don't come to 10am office hours if you can't come to a 9am lecture.Right?If you need to sleep in,sleep in,that's fine.I'm not going to take it personally.We'll try to put some videos up on the web.That's why we're taking it today.So,on the other hand,if you come to office hours,and you want to help at 10am,and you weren't able to get up at 9am,then I think the TAs will be less interested in helping.But we will also schedule some PM office hoursin people's office.I know that people have different schedules.Okay.Any additional questions before we get started?All right.So,to start up the day,I want you guys to do something very simple.Everybody stand up.Okay.Turn to somebody here by you that you don't knowand interviews yourself.Good day.Good morning.The other thing is,if you are seated in a seat that has a numberthat is higher than 158,please get up and move into a seatthat has a number that is lower than 158.People from the back or the classroom,please come forward. plenty of room in the front row, guys.This is the room for my committee.I'm sitting here like this.I'll sit there.I'll sit here.I'll sit here.I'll sit like this.I'll sit here.I'll sit here.I'll sit here.I'll sit here.I'll sit here.I'll sit here.This is my high-to-air.We've had some work that we didn't.But I'm in last year.You know the bottom line?I know the bottom line.I'm in last year.You see?You see?我們很想要求以暴力而生而不順利我們很想要求以暴力而生不順利我們不順利不順利不順利不順利不順利所以今天我們要討論運作系統的資訊你們在場我們講了一點點因為它不夠所以它們的主要目標是另外一個在通過的資訊所以今天我們不談運作系統我們會談Processes and processes happen to be the OS abstraction that does not map down to hardware,direct unlike threads, which map down to CPU,virtual address spaces, which map to memory,and files and other file abstractions that map onto disk.So processes are kind of an organizing thing.So we're going to talk about abstractions today,not old-fashioned,and abstractions are designed to do a couple of things.So before when I asked you how many people have usedsome sort of programming or system abstraction,raise your hand again.That's better.Before it was like five of you,and I was thinking,you guys write an assembly code?So if you've programmed in any kind of language,you've used an abstraction,abstractions are designed in the operating systempretty particularly to do a couple of important things.So let's see,what's one important thing that an operating systemabstractions do?So it simplifies the programming style.Right.So it makes,the design makes things easier for the program.It's easier to work with a filethan it is to have to figure outhow to write raw blocks to disk.It's also easier to let theoperated system handle context switching for youthan to figure out how to save your stateand restore it.Now there are libraries that do this.So how many people have useda user space threading library?How many people have used threads on Linux?More than maybe one or two years ago.Then you've used a user space threading library.So this is possible.But in general the idea about abstractionsis to simplify things for the program.Right.What's something else that abstractions do?Right.So abstractions have an interface.Right.That's a property of abstractions.But why do they have an interface?Let me go a little bit.To hide the underlying implementation.Right.So one of the questions on thepreterm that I think that there weresome people that seemed to struggle withwas this question.Maybe it was a trick questionbecause maybe the answer impliedsomething about your fundamental suspicionor feeling of the operating systemsare designed properly.But operating systems are designed toseparate policy and mechanism.Right.Not entangle policy and mechanism.Implementations entangle policy and mechanismare tend to be pretty terrible.Right.We're trying to stay away from those.Right.Operated systems are really designedto do the opposite.We're trying to set the rate of policy.Right.And in some ways,interfaces embody a policy.Right.So an interface creates a contractbetween the caller and the calleethat says this is what the calleewill do for you.And this is what you can expect.But other than that,you can't count on any otherkind of behavior.Right.So when well specified,interfaces allow the callersorry,the callee to do exactlyyou just pointed out.To changethe implementation.So can anybody think of an exampleof this kind of thing.And maybe use an OS abstraction,maybe use a different abstraction.Right.What about files?Is anyone,what's the majorship that's going on infiles storage technologies today?Cloud computing.Cloud computing.Okay.Cloud computing is a good one.I'm thinking of something else though.Flash.Right.We can talk about both.Cloud computing and flash.Right.What is different about flashand spinning disks?There's no moving parts.Right.Flash is solid state.Right.It's kind of like permanent memory.Now when we get to the file systemport of this portion of this course,we're going to studyto some degree,not to a hugedegree because it's kind of startingto be antiquated.A lot of theold tricks that file systems usedwhen disks spun aroundin circles.Right.So what's one property ofdispinning in circles that'ssignificant for file and filesystem design.Okay.That'sfine.If you don't know,justsay that.Let mepeck up something else.Right.Locality matters.Right.There's such a thing asdislocality.So where theheads are,so the disk isthis platter with these littleheads moving around it.And wherethe heads are at a particularmoment in time has an impactit will take to acquirea block of data from anotherpart of the disk.Okay.Is this true on flash?No.Because there's no moving parts.Right.Now,however,just becausethis comes back to anotherpre-turn question,locality isimportant on flash.And that'sbecause flash wears out.Right.We'llcome back to this,but flash.So flash hasdifferent properties thanspinning disks.Right.The nicething is thatdespite the factthatthere has been this big,thereare going on in storagetechnologies,the fileabstraction that operatingsystems have provided to applications has remainedthe same.Right.Theimplementation haschanged,the performancerequirements havechanged and there's a hugeamount of underlyingchange that goes on,butthe fundamentalextraction is still thesame.And at the veryend of today's lecturewe're going to come backto another example wherethe Linux operatingsystem kind of abuses,Ishouldn't say abused,cleverlyreutilizes the file systemabstraction to expose跟不同的資料所以領導分辨 policy for mechanism提供了 an interface提供了 mechanism to changeOK所以在這個項目中我們會討論有幾個因素的領導而我所說的之前很多領導的領導直接往下這些比較漂亮的照片我們會用來提供領導的領導然後希望他們不會改變這項項目是完全可能的可能會發生今天好所以領導的領導是一個領導在領導的領導有幾個領導的領導在領導的領導所以領導的領導是一個領導在我所說的領導的領導領導的領導領導的領導有很多大部分的領導的領導在領導的領導那領導的領導有幾個領導是如何分享領導的領導對好所以你們你們很 familiar with processes對其他 than filesprocesses are probablythe operating system abstractionthe most people the most familiar withSo, what is a process?給我給你一個 example of a processThis is a very easy process對This application is running GIll me an exampleA process that you use recentlyI need a lot of thingsOK, now processesimmediate playimmediate playimmediate fileimmediate playimmediate playimmediate playimmediate playimmediate playimmediate playOK, great, immediate playerapplications, you guys know processes as applicationsI think they've got windows, they've got buttonsthey've got an interfacea lot of processes are user facingyou guys know what these areanother technical problemyou guys over here are talking about processes explorerprocess explorerOK, there we gothe meta processOK, another example of a processchrome, sureyeahso the applications you use on your computerare processesrightand that'sthis is the way to think about themright, so what dowhat processes is integratedso processes havethings that are up on the slideright, so let's go throughOKRoberttell me one of the thingsthat a process containsone or more threadsno stop thereyou can't take two answersgot to get somebody elseone or more threadsright, so what are threadsthreads are represent thingsthat the operating system is doingthreads of executionthings that are halfright, we're going to go throughan example of this in a bitrightsomething else that an operating system containsthis is on the slidethese are easy questionsyou and the buffalo billsanother spaceanother spacealright, I like thatbecause it's kind ofpatriotized almostif I split part of itanother spaceso a process is using memoryit's using memoryfor a variety of differentthingyou could think of memoryas temporary storagetemporary fairly fast storageephemeral storagesomething elsethat processes useit's kind of so far as likereading comprehensionI promise I'm making this hardbut I have some laterlike little reveals on the slideI'm getting better with myright, so operating systemuse filespermanent storagepermanent storage on diskthat tends to survivereboots and processstop and startalright, so processeson an operating systembesides collecting informationorganizing abstractionsthey also provide aprotection boundaryso to some degreean operating systemguaranteesthat multiple processeswill not be able tostop on each otherrightso if I launch a processon my systemit shouldn't be able tokill off other processesmake the system reallyslow and unresponsiveetcnow this is alwaysthe case in practicenohow many people hereare old enough to useto have used likeold versions of windowslike 95, 98so windows took about30 years to discover stuffthat unix had inventedin the 70srightone of those conceptswas protection boundariesbetween processesso old versions of windowshave all sorts of different waysthe processescould stop on each otherand make life miserablefor each othernew versions of windowsten to have fixedthese problemsrightbut to some degreethis is a common themethat all operating systemsshareis that they try to make surethat processescan't stop on each othernow inside of a processthat's your businessrightthat's like your littleprivate domainis the programrightso an operating systemis not going to guaranteethat stuff that you dowith your own resourceswithin the process containerare correctare safeare going to leadto your process behaviorrightbut that's kind ofthe programmersrightso the operating systemis essentiallyguarantineor agreeingto provide these kind ofboundariesbetweendifferent processesand programmersare expectedalrightsoinintroprocess yeahcan you callvirus a processexcuse mecomputer viruswould be called a processbecause it would be runningit crashes the computer as wellso rightokay a computervirus would be a processrightcomputer virusestend to be processesthat exploit bugsin other processesrightso a computerviruswhat is the commonsoat some pointlittle trivia questionfor you guysrightremember which versionwas itvistaMicrosoft Vistacame outsomething liketwo or three yearslaterightand thennobody liked itbutone of the thingsthat slowed downthe watch of Vistadoesn't anybody knowwhat it wasMicrosoft did a hugesecurity auditat their entirecodebasewhere they pulledprogrammers offsecurity reviewsof this hugecodebase that they calledwindowsand othercoursersand the reason for thatwas to try to preventthese sorts of bugsrightso a typicalI'm going to get backto my flow in a minutebut I'm answering a questionbecause I think it's a cool questiona typicalprivilegeescalationrightso as anybodythere are websitesthat record theserightdoes anybody followthis sort of thingfor LinuxI don't reallybut I think it's kind of neatthere are people thatbasicallyhackersfriendly hackerswho go out and tryto break Linuxrightso they try to find waysto escalate their privilegesand what that meansis they try to find waysto execute as the root userrightbecause the root useron the Linux systemhas special privilegesthat can do a lot of nasty thingsto otherto other processesand parts of the systemrightso basicallywhat these people dois they try to find waysof running programsor exploitingholes in thesoftwareso that they can thenget more privilegesthan they're supposed to haverightso typically on most systemswhether it's Windowsor Macor Linuxthere is a special userthat has privilegesthat allow it todo thingsto other processesthat we mightnot normally likerightand that's donefor management purposesif you canmasterate as that personthen you cando a lot of damagerightany other questionsrightso communicationwithin a processis pretty easyrightsomeone can give me an exampleof like a canonicalmulti-threaded applicationanybody have a guessstarting with youron the side of the roomany guessesnothinhow about youcat-progress maybewhat's thatcat-progresslike anything thathas an interfacefrequently will utilizemultiple threadsto do different thingsrightyou have one threadthat's redrawing the screenyou have one threadthat's waiting for user inputyou have another threadthat's doing somethingin the backgroundthat's an exampleof a server applicationto buy itmultiple threadsa web servercanonical examplerightthreads within a processcould communicatewith eachother directlytypically by justusing memoryrightso threadone wants to communicatewith thread3it can just writeinto a shared memoryregionlike keyrightsome of this stuffwe're gonna come backwhen we talk about memorywe're just trying togive you some ideasof where the boundarieslawin terms ofcommunicationthere's a lot of opennesswithin a process itselfrightthis doesn't necessarilymake things easyrightbecause there are a lotof synchronization problemswhen you start to havemultiple threadsand we use somethingthat we will talk aboutin detail next weekcommunication betweenprocessesis harderand more structuredrightwhy is thatwhat's the thingthat the operating systemis trying todo for processesin the backyeahwhat iswhatan operating systemis trying todo what betweenprocessestrying towhy would inter-processcommunicationbe more structuredand more difficultwithin a processthat'sthat's onepossibleit's notwhytrying to get a scheduleand stuffbecause there are a lotof processesoperate andpossibleto watchrightso there could beresearchableproblemsbut I commentedit's somethingmore funaboutthe operating systemis designedtoprocessrightthe OS wants toprotectprocessesfrom eachotherrightand socommunicationbetweenprocessesis onepossible channelwhere myprocessmight do somethingbad to yourprocessrightsofor exampleif I want toshare memorybetween two processesboth processeshave to set upthat share of memoryregion rightso it's an optinsort of thingI can't justdecide to shareyour memoryrightlike you're running alongand I'm likehey I like that pageand I'm going towrite some data into ityou knowthat doesn't happenthat can happen insidea processbetween two threadsbut it willnot happenbetween two processesbecause both processes older versions of windows, this would happen, right, and that was one of the issues, right, because, you know, there could be this kind of sharing that was unintended sharing and where one application was not conducive, right.So here's one way that processes can communicate with each other that maybe illustrates some of these problems. So this is a file that both of these processes had opened down here and process A has written something to the file and process B could read it.What are some of the problems with this? Anybody?Right, so I need to have some semantics for how you and I are going to share this file, right. I don't necessarily know if you're done writing data, I don't know where I can write it, especially, so this is especially critical when two processes are sharing a file and trying to write to the file at the same time, right.Because, you know, if I write data and you write data to the file at the same time, it's essentially a race, right, and whoever writes last, that's the data that's going to appear.How many people have used a file system like NFS? A network-mounted file, right.I am using it.So if you guys have used a shared computing environment, you've probably used something like NFS.So again, we'll come back to this in the file system here, but NFS has very loose requirements for how it opens and locks files.And that can create a lot of problems here because if you're not careful and two, you know, two users that are logged into different machines that are accessing the same shared file can essentially run into this problem.And the real issue on NFS is that NFS doesn't have a notion of a file being opened, which as you imagine is kind of an issue because I can use openness to prohibit other people potentially from modifying the file, right.So if I open the file with certain rights, that means that other processes won't be able to open it, and I know that I can write my data to the file without fear of somebody else stopping it, all right.Questions at this point.I want to go through a couple of other inter-process communication mechanisms because this really kind of helps us get at the process extraction, right.So Exit Codes.When I started writing these slides, this is really interesting, right, so Exit Codes.It's so, I don't know, I'm fascinated by Exit Codes, right.It's just this teeny-weeny little piece of data that processes can pass between each other, right.When a process exits, it returns an int.That's it.Like a number that is, you know, supposed to indicate something about what happened, you know, what did it finish properly, did it crash,etc.That Exit Code is available to the process that created that process.So on Wednesday we're going to talk about process lifespan for exact things like this.But the point is that the return code is one, one very, very limited form of IDC.It can only be sent when the process exits.It is only received most cases by the process parent.So I threw in some examples here that the green's not showing it pretty well,but showing you, you know, how to collect Exit Codes using BASH, right.How many people are familiar with BASH?I know I should know this for the free time.So what I can see here, what does BINTRUE do?Anybody know?BINTRUE.It's kind of a funny program.We'll learn more about this later.It's fine to be open here.BINTRUE returns 0.That's all it does.It's the simplest, maybe the simplest possible unit program, right.And again,0 here is normally indicated, used indicates success, right.Where non-zero indicates failure.And there's a lot of different ways that a process can fail, right.And a lot of time processes will establish fail codes.That means that if a process returns 2, you look that up in some table.And it says, you know, the process ran out of memory or something, right.What about BINFALSE?What do you think BINFALSE does?Should be able to tell.It returns 1, right.Error, right.That's all these things do.So this shows you from the shell how this looks, right.So if I basically run a sleep command, which will wait for 5 seconds,and then run BINTRUE.When it completes, you see that it just says done, right.That's the way of the shell telling you.It just completed, okay, no problem, right.BINFALSE,however you can see that it says exit 1, right.That means that the process BINFALSE exited with exit code.If you've run a command and you don't know what happened,and you'd like to retrieve the exit code after the command finishes,bash has this special variable,which is,I guess,a dollar sign followed by a question mark.It simply says,and that will,if you print that variableor echo that variable to the terminal,that will tell you what the exit code wasthat the process that just ran,it just finished return.And this can be helpful,sometimes you'll run somethingand it won't seem to have done anythingand you'll want to kind of know what happeneddid it work,did it not.pipes,right.Pipes are anotherUNIX IPC mechanism,right.So how many people have run a commandlike the one up therethat used the pipe operator,right.So pipes are a way of transferring databetween processes,right.And again,it's another simplefairly structured form of IPC,right.Linux sets up pipes as essentiallya buffer between two processes.So all the output from my PS commandwill be written into a pipewhere it can be retrieved by the grub command,right.And this is,again,another sort ofstandard way of doing IPCand if it's,UNIX has this design philosophywhere,which maybe distinguishes itfrom some other programming environmentsthat you're familiar withwhereUNIX likes to distributea lot of small utilitiesthat do one thing very well.And then it's your job as a programmerto chain them togetherto achieve something that you want.And I'm sure if you go onlineyou can find examples where peoplehave chained togethersome six different commandsusing pipesto do something,right.So rather than writinga standalone programto do something specializedyou take,special,you knowsingle-purpose programsand kind of chain them togetherin a nice way,right.And this is somethingyou can do from the command line.And this is especially nicewhen you're trying to solvea problem that you thinkyou'll never need to solve again,right.You just need to solvethat one line.Alright,signals.Signals are another formof IPCthat processes can engage it.Signals actually havea lot of overlapwith interruptswhich we're goingto talk about later this week.So processes cansignals are an asynchronousdevice where anotherprocess can senda certain kind of signalto a second process.That process has the optionbefore the signal arrivesof establishing signal handlersto process that signal,right.And a signal handlermeans when that signal arrivesthat process will bewill jump into a signalhandler and executeSo you guys have allI bet anyone who has usedUnix has used signals,right.Arrays your handif you've usedUnix or LinuxHave you used signals?Have you everhave you ever exited a process?How do you do that?I'm just exitinglike a program.No,no,no,but let's sayit's running and you wantto stop it.But how do you do that?Like if you're inthe terminal.PTRL-C,right.PTRL-CPTRL-Cis implemented by sendinga sick-term signalto the process that's running,right.Most processes handlethat signalby shutting down grazing.You can write a processhowever that ignoresPTRL-C.If you write a processby default usingthe standard C librariesPTRL-C will shut down.However,you canwrite your own signal handlerand you can write a processthat if it runsit will sit in a while one loopand if you hitPTRL-C it will not stop,right.I don't know why youwould do something like thatbut it can be done,right.If you look up onlinethere's a whole bunchof different signalsthat you can send,right.So here's an exampleofusing kill,right.Now kill,despiteit's fairly aggressive nameis not just aboutkilling processes.It also sends signalsof anarbitrary number of types,right.So by defaultkill will send sick-termbut you can usekill to send any sick.And some of the signalsdon't kill the process at all.There are signalsthat tell the processre-read your configuration file,right.So if I have a web serverthat's running,for exampleand I've madesome changes to the sitesthat I'm servingand I'll have tostop it and restart itI can send ita certain kind of signalthat saysI've made someconfiguration changescould you re-read it.And if it handles thatprobablyprocesses can alsoignore signalsas I saidsick-kill isone particular exception,right.processes are notallowed to ignoresick-kill,right.Sick-kill willterminate the problem.It's usuallya fairly ugly name.Questions.Ok,so what about signals?I mean is thisa safe mechanism?Can I just senda sick-killto your process?No.Why not?We don't knowwhat does the processthat interact with that.Well it's not just thatit violates theprotection boundariesthat the operating systemis trying to establish.So normally a waysignals work isthat I can only senda signal toone of my ownprocessesthat I've createdthat's associatedwith my user writing.If I try to signalsome other processthe signal justdoesn't get through.Alright,so we'regoing to come backto filesand other things.Alright.I just wantto stop here brieflyand talk a little bitabout terminology.So there can beat times a little bitof confusionbetween processesand threads.And there's alot of terminologyout there.What I'm tryingto do isintroduce you guysto a certain setof conceptsthat basicallymap downto any operatingsystem you use.Windowsis a wholedifferent universe.Linuxsometimes callsthese tasksso anywayyou're going to bea little confusion.So processesand threadspartly the confusionis becauseyou talk about aprocess runningwe'll also talkabout a threadrunning.In this classprocessesare containerabstractionthatand processescan't bescheduledwhich meansthat a threadthat belongsto that processis running.Just seepused.That'show we're goingto find this.All right.So let me go throughan exampleof a processand we'lltalk aboutsome of the partsof the processand what theymight befirefox.Unless you'vebeen livingunder aditch.I guessyou don't liveunder aditch.In aditch.You knowwhat firefox is.What'sthreadsbeendoingWhat'sthreadsbeen doing?Thein theintentional speech.Noin theina.Right,rightright. SoFirefoxwill haveso when Iooked atFirefox onmy laptop我會用火火石頭髮會用火火石頭髮會用電源會用電源我確定火火石頭髮是一個分的髮型至少一個如果你想用火火石頭髮會用80髮這會有很多我會用這個東西會把整個髮型關掉那要用火火石頭髮會用火火石頭髮因為它說每個髮型都會用火火石頭髮我不能說火火石頭髮我用了我用了這類的充滿了火火石頭髮不能動好火火石頭髮會用一整個髮型火火石頭髮會用火火石頭髮會用電源每個髮型都會用火火石頭髮會用火火石頭髮會用火火石頭髮很 created tons of火火石頭髮在我系統上的過程中的過程中對所以在下載時間 loader will mapsome of those shared librarieswhich are filesrightbut they end up being mapped intothe process's address spacebecause they're actually executable codethat the process is actuallyrightand then another examplewould be the heaprightdynamically an allocated memorywhich is probably used for the cacheit's probably used for extension storagerightand then what elsefirefox has threadsthreads have whata stackrightlocal variable storagealrightokthen fileturns out file foxdoesn't actually have that many files overat least when I lookedbut what might it have files over forfilesfilesdid someone say filesoh waitI'm going to pretend you said filesbecause that's a fantastic answerI was surprisedit has file files overI didn't think anyone was going to sayso I'm talking aboutI'm thinking about file fileslike disk filessockets you're rightsockets look like filesbut fontsrightwhat elsefiguration filesso firefox loads somefiguration filesalrightso let me talkwe've got about 10 minutesso let me talk abouthow you find informationabout processeson your own systemrightso how many people have runtopon a system beforerightcoolthis is a pretty useful utilityrightthis shows you a lot of informationabout what's going on in the systemrightI ran thisall thesewere run on our web serverrightjust isn't doing much right nowbut you can seeI mean this gives you a pictureofwhat's using the CPUhow much memory is allocatedhow manyso againlinux has the idea of a taskwhich is essentially somethingthat's runableso a task can beeither a thread with onea process with one threador a thread insidea multi-threaded processrightso this saysthere are 58 tasksright57 of them are sleepingwhat about theseCPU stateswhat do you thinksome of those need0.2% USwhat is thatuserspaceuserspacemount of timethe percentage of timethe system has spentexecuting userspace codeSYjust excuse merightand then IDrightso thismachine's not doinga whole heck of a lotalrightso let's go throughan exampleof a processbashsimple shelland we'll find outsome informationabout howthat you're usingthese utilitiesrightso the first thingI need to dois figure outwhat theprocessed ID isevery processon a systemhas an IDwhich allows the systemto refer to itand allows youto refer to itrightpeople who are too lazyto do the first thingand thenI can alsoif I knowit's money lowrightwhen I log into the machinebash is the only thingso I can just runps and I can seerightso now I've got my process IDrightand that's the beginningof the informationI'm going to applyabout the processand I need thatto collect other piecesalrightso nowI could runps with a little bit moredetailed outputrightnow let's go through thistogetherlet's seeI want to find a roadI'm going to goin this wayUIDyeah there we gonextprocessed IDprocessed IDPKPared Processed IDPared Processed IDgoodlet me go backTRIokput some mobile in over herego PXSCsignsrightso it turns outthat's the amountof memorythat the processcurrently hasactuallyactuallyI don't know what that isit's going to come up nextW Chanso that'skind of a descriptionofif the processis waitinginside the kernelwhich bash iswhat is it doingrightand it turns outthe bash is calledwaitrightwhy did bash callwaitbecause it's waitingfor ps to exitrightit's runninga programwhen I ranrightkeep goingRSSI don't knowmaybe somethingabout sizeso I thinkit has mappedin its outer spacerightand I thinkSZif I remember correctlyis the numberthat are actuallyin memoryrightthis isn't kilobytesso bashis you wouldexpectit's you know3.7 megsof totaland it's onlygot 1.7they'recurrentlyrightkeep goingtimesome measureof how much timethe processhas been runningrightand in this caseactuallyin and bashand bash doesn'tdo much anywayquestionif theprocess crasheswhere is the informationthat itrecovered fromwe'll talkabout thatonce thenis that okayso theexecode is storeduntil theprocess parentreves itif theprocess dumpscorethat's usuallystored in a filein the directoryallright so againhere we goscandalingprioritycore imagesdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdashdash另一邊,有人說過,這是什麼程序,有幾個程序沒有人說過,這是C.S.421的網絡所以,這裡有,Apache所以,這是Apache,如果我來P.S.,我可以看到,這是我的程序然後,如果我來示範,這其實是17個程序Linux 程序是 known as light processing所以,這是LWP每個程序都有一個I.D.然後,他們都可以預約這些 are all threads that belong to a single processAll right, so let's look at PMAP其實, when I started writing this lecture, I had to use this toolBut it's kind of cool, right?PMAP will show you the memory mapsome description of the memory that's in use by the fileAnd a lot of it isn't very helpful, because for exampleif I allocate heap and then I use it for like firefox configuration filesit's impossible to tap, right?All I can tell is that the process allocates a heapSo again, here's Bache, right?Bache has its code, that's good, right?Now, why do you think there's...So Bache actually has its code mapped three times, right?With different permissions, why is that?So the first segment is marked read and executeWhat do you think that is?What's that?The one you're currently in, the actual terminalSo that's the code, right?That's the immutable code, right?It's executable because I'm executing itAnd it's read only, I can't writeSo there is a history of people that wroteself-modifying programs that would modify their own codeas they ranThat has typically been decided to be a bad ideaSo most, now today, by defaultcode segments get marked as read onlyWhat's the next?It's just readA portion of Bache's code has been marked just readWhat could that be?It's like a critical part of the code that cannot be modifiedSo it can be modified because it's read onlyBut it's also not executableThis is where programs store static variablesA variable that's never going to changeOr some portion of the code that's not executableBut it's never going to changeSo variables that get setThey get set inside their suitable fileAnd then the last part is RWWhat is that?What's that?No, I know it's re-writeRe-write, goodYes, what is it?What's in there?Global variablesExactlyStatic global variables that you allocatein a program go in this areaBecause they're read and written fromBut they're not keepKeep, we dynamically allocate using mailYou can also see that Bache is using some librariesThis is libcImagine it's using libcI'm guessing that 99.99% of the programs are on this machineThis is libcAnd then at the very endI've got one thread and I've got one sendAnd it turns out if you computeThe address thereThat is the very, very, very, very, very, very, very tipity topOf the virtual address space in the processCome back to virtual address settingIn a couple of weeksFinal tool, LSOLF, and this actually can be kind of a helpful tool. I use this a few times. This will show you files that are open by a particular process.And what this shows you is that BASH has file handles that point to the console, standard input, standard output. This is how it reads and writes characters. And that's configuration file.Except for the fact that I made that up. Because when I ran it, LSOLF, there was nothing interesting open.But I just decided, hey, you know, I'm sure when we start BASH, it reads this configuration file. So I just pretended that I caught it right at the right moment.I beg your forgiveness, but it made for a good reason. Alright, so this is it. And this is again, I hope I haven't bored you yet, but I hope I've given you some idea of the components of the process and how they work.So I want to make one quick remark before we leave, because I think that this is kind of cool. So how do these programs that we've just used, PS, TOP, PMAV, LSOLF, where do they get this information from?So it turns out that Linux does this interesting thing, where it exposes this information through a file system interface.So what I've shown here is, I guess I didn't show them out. Okay, if you run MAT on a Linux machine, and you guys will be able to do this later today when you start using our virtual machine that you're going to use for the class, because it's going to run Linux.You see that the PROC file system is mounted on slash PROC. And the PROC file system is not a real file system. It looks like a file system again. I can go in here.So this was my shell 7615. And if I look, if I do have a lesson inside my shell directory under PROC, there's all these files that contain interesting information.And if I had space, I would have showed you kind of what's in it.But this is all fake. The operating system creates this on the fly and as needed in response to things changing.So this is not implemented by writing files onto the file system. This is implemented by intercepting file system calls and doing the right thing.So when LS asks what's in this directory, the operating system intercepts that call and populates it with information appropriate to this particular process.And if I would display these files, it does the same thing.So this is kind of an example of how I can use this hierarchical file system model to organize other pieces of information.So this is something that operating systems do.And actually on operating systems today, there are a lot of what people think of as file-like objects.Sock is network-based files and the PROC files.So it creates its own file system for each process?So under PROC, under slash PROC, if you did an LS under slash PROC, you would see that there was a directory for every process on this system.And they're all across this ID.But again, those calls into the kernel, there's no real file.There's no, like, if you looked, let's put it this way.There are no dislikes that are holding this information.All the information is in memory somewhere.It's probably being challenged so that the operating system doesn't have to rebuild it every time.But these files don't map onto diskbox at all.They're completely constructed to allow processes to retrieve this information in a well-structured way.Otherwise, if so, MAC, for example, doesn't have this.It has a Unix-like operating system, but it does not have PROC.And what that means is that MAC tools that display this information have to make these kind of funky system calls in order to retrieve the information directly from the kernel rather than just navigating PROC.We're done.Do you guys have any questions?So, let me talk quickly about next week.So next week, I wish.So, what available?So I'm going to start putting my slides up onto the website.The slides are all HTML, so putting them on the website is not a hard problem,but the website needs to exist and kind of do something useful first.These slides will find their way up on the web as fast as possible.My first priority today is to get the assignment out,so maybe not for the day or two.But this will be up there.On Wednesday, we're going to talk about the process life cycle.We're going to talk about where processes come fromand the different portion of the operating system interface that we use to manipulate files.No, it's processing.Alright, we'll see you on Wednesday.Thank you.I do turn off this.


We agreed to have a podium so that when he recognizes people who wish to be heard You could look at them downwards and recognize them more effectively, but for some reason we have been moved downstairs So here we are Anyway, I'm delighted to welcome all of you here. This is a very special event, which we are very proud to sponsor We have a friend and a colleague who has just recently written an important book And this will give us all an opportunity to exchange views Concerning it and the subject much more important subject that he also addresses But first, let me say a word or two about procedure after introducing Ed He'll come up here or he'll actually descend down here And give you more or less a quick overview of the book. He's not going to engage in a prolonged summary But it is a safe assumption that maybe there are two or three or four people in this room who have not yet read the book So this might be helpful to those of you who are so delinquent and after that He'll return and sit with me for a few minutes and we'll talk a little bit about the book I had the opportunity to read the book So I'm not one of those three or four and I do have some questions I'd like to raise Now beyond that let me first of all say that That probably this is not necessary that Ed Lewis is really very much a figure in this town He plays an important role in commenting about American politics He's viewed as extremely well-informed and incisive What he has to take what he has to say is therefore taken very very seriously He has Significant outreach beyond the city in the country because FT is read widely But also around the world and he is today one of its leading commentators and world affairs He is as I'm sure most of you know a Brit a Brit But resident for a number of years in the United States. He still retains his elegant Accent which clearly qualifies him without any tests for a senior position in American television as you may have noticed lately and He has had an experience also in American politics by working closely with Larry Summers and in fact serving as his speechwriter When I read his book just over this weekend in fact I Was struck by a thought which made me look at the book in a somewhat different perspective It so happens that earlier in the year. I had reason to reread the talk of ill Who 175 years ago traveled to America and wrote a remarkably optimistic? analysis of American society But I read Ed's book and particularly the scope of his interests and his Really unique ability to relate to people and to pump out of them Insights which are of current significance. I thought of the parallel with the talk of ill But obviously also of the rather different perspective that he projects on America today That feeling of mine was reinforced on Sunday when I read the review that appeared in the New York Times Book magazine and incidentally on the first page of that which is a very specific distinction and in the course of reading that interview In the course of reading that review. I was struck at the reviewer at one point suggested that he would have had a different title for the book the Time to start drinking he suggests Now if you start drinking Presumably the end result is some sort of state of delirium So I wasn't taken by that title, but I asked myself what would I offer as an alternative title and what occurred to me was Time to start praying Which is a much more hopeful Conclusion because prayer is designed to achieve an end effect and the benign one in most cases Because God dismisses the malignant prayers So start to start to time to start praying is really a more optimistic perspective Only what otherwise is a very serious examination of contemporary America So with that as the introduction let me yield the floor down here below to you And you can carry on for now very much Thank you very much That was an immensely generous and Totally unearned introduction, but I'm nevertheless deeply great grateful for it also to CSIS Andrew Swartz For setting this up and of course is this you're getting feedback a little bit of a setting this up But they were there's Andrew. Thank you very very much for this and most of all too big for not just Moderating this but also for as a journalist Making his extremely fine nuanced and experienced brain available to me and others over the last few years So, thank you very much. This is a great honor A couple of caveats. I will I'll try and summarize this in a Short sort of 10 12 minutes if I go on too long, please stop me. I've got a 20 minute Stuck in the elevator with me pitch. I'll compress this into 10. I hope two caveats before I do The first is as big said, I mean, this is not exactly an uplifting book But I don't want you all to feel Suicidely depressed by the title. It's it's not quite as bleak as the title and subtitle in particular America in the Age of Descent might imply And as big said time to start drinking. I think is a very good. I laughed I laughed quite a lot when I read that line in the New York Times review on Sunday Just just to say that if I'd concluded with a saccharine prognosis of a saccharine ending to this book it would have been unearned unmerited by what? By what preceded it and so it just simply wasn't merited and I don't think it's the kind of response to the very Complex and that multiply interrelated challenges the United States is facing I don't think it would have been a practical way a response simply to say to fall back on the Exceptionalist lines that nobody ever made money Betting against America etc America always pulls through my second caveat Refers to what's big very kindly again unearned. I think refers to as my elegant accent, which is by now you will have worked out isn't the best accent with which to market and summarize the kind of thesis that my book contains and You know, I'm very acutely aware of the fact that people from my country in the last few years from Prime Minister's Urging America into questionable wars of choice to to historians Urging America to step up and Pick up the baton as the last great imperial power of the English-speaking peoples I'm very aware that there are others of my nationality with with different views and I just want to differentiate myself from them and also to Differentiate myself from another kind of compatriot In the late 80s when Paul Kennedy wrote his decline and fall book I'm not distancing myself from him by the way Samuel Huntington wrote this Famous piece defining an American declineist as somebody who wishes for America's decline I'm not in that category either that by that definition I'm not a declineist and if looking at my own country Britain and the multitude of problems it faces And the fact that it is even more dependent on the financial sector Much more in fact for growth than than the US But lacks an international reserve currency I might even consider a book on Britain and tightening a book on Britain time to start sniffing glue Because it's not not not looking too good none of which is to say that the American exceptionist nostrums Are the way to respond to the problems America faces and I have perhaps unfairly Picked on in one or two of my columns recently on Bob Kagan Robert Kagan at the Brookings Institution Also senior advisor to foreign policy advisor to Mitt Romney Whose book the myth of American decline? I think summarizes this exceptionalism and why it's not the best way of looking at The challenges America faces and I pick on him partly because Barack Obama made it known that in his state of the Union address It was Kagan's essay that inspired him to To say the line anybody who talks of America being in decline doesn't know what they're talking about Kagan in his book remarks that America's share of the global economy was and has been at Remarkably stable at roughly a quarter of global GDP since the late 1960s And so I checked these numbers out with the IMF and double-checked them and at market exchange rates The the accurate number is that in 1969 America 36% by 2000 it was down moderately to 31% But between 2000 and 2010 it dropped from 31 to 23 point five and that's a very sharp drop And I think starting on the premise that that isn't happening is a kind of ostrich position to take and Borrowing a cataclysm in Brazil China elsewhere that the rest that are growing Outstripping American growth then America will fall to about a sixth Of the world economy in the early 2020s and I think this is this should be uncontroversial So this isn't the principal subject of my book The principal subject is how America is responding to its relative economic decline and also the multiple economic challenges posed by Exponential globalization the hyper integration of the global economy and also by the Again exponential rate of change of technology and what that's doing to the world of work and to the American Middle-class and to their relative skill sets against the rising rest Let me give you three very very brief Summaries of the core points contained in this book first is The American economy is Latin Americanizing I think that's the best the best way of framing it We're all aware most people are aware that since the late 70s since the early 70s in fact There's been a median wage stagnation the middle class of Failed to keep pace with in many years the rate of inflation and that large sections of the middle class a very little better off Today than they were in the 70s I think what's less well understood is how that process has deepened in the last decade and accelerated and become far more prevalent a mainstream fact about the American economy In the o2 to o7 business cycle expansion This was the first growth period on record in American history where the Median household income was lower at the end of it than at the beginning by $2,000 for the for the median household Since o7 of course, we've had the great recession and then since mid 2009 We've had now almost three years worth of recovery now The median household income during the recession went down by 3.4 percent as you would expect roughly With a recession since the recovery began the median household income has gone down by 6.7 percent so in other words as the economy has grown for most people it's continued to be a recession in fact that recession is in By many measures got worse for them than the actual recession Now a few weeks ago The two economists at Berkeley Thomas Piketty and Emmanuel sites Showed the kind of distribution that we're seeing in this recovery Which is another way of expressing what I've just said Namely that the top 1% have taken 93% in the year 2010 the first full year of the recovery The top 1% took 93% of the growth from that year the remaining 99% left with 7% of that and almost all of that 7% went to the top Decisive so in 2010 and again in 2011 The majority of American workforce were poorer than the previous year But the study also showed that the top 0.01% in other words the top one in ten thousand fifteen thousand six hundred families the wealthiest in America Took almost 40% of the growth in that year We see these trends going back to previous cycles But it each year the share going to the top of a first year of recovery with each expansion Gets much higher. It was about 45% in the Clinton Recovery 93 94 it's gone up to 93% going to the top 1% Now if that number doesn't give you a whiff of the Latin American Hacienda I don't I don't know what will but you could look at the politics because this isn't just When I say the Latin Americanization of the American economy isn't just confined to outcomes in the market system I think I don't need to rehearse. We're in Washington I don't need to rehearse the that we're not going to have a budget for the fourth year running that we can't get a Proper infrastructure bill together that the budget for worker retraining and community colleges is Plamenting by about 40% Overwhere it was in 0607 Now that the stimulus money is running out the fact that Washington is dysfunctional is well known to all of you but if you look at the classic Latin American pattern of politics it's a swing from orthodoxy to populism and back again in the greatly stabilizing lurches that the classic Latin American democracy saw And I fear that the United States is exhibiting very much that connection between the polarization of the economy the polarization of the labor force Into a cognitive elite and then a non cognizant cognitive elite with two very very different Responses to the global economy and the polarization. We're seeing in American politics second I've probably a lot taken up ten minutes already, haven't I I'll accelerate these two final points second is competitiveness Now whenever I talk to people about the difficulties the widely acknowledged difficulties with the health of America's political economy People say yes, but America has the ultimate get out of jail free cart Which is the ability to remain the world's leading innovator Unrivaled innovator, and I think this is true America does remain the world the world's unrivaled innovator But if you look at how it's failed to maintain its innovation infrastructure in the last 10-12 years And I'll give you one example ITIF information technology and innovation foundation rank globally on global competitiveness and Innovation measures and multiple measures America now comes forth. It's not not alarmingly low And the three countries ahead of it include people like Singapore not strikingly large places But if you look at the improvements to innovation infrastructure in the last decade the 40 countries ITIF ranks America comes 40th out of 40. So we are facing a new situation and for this book I spent a lot of time in Silicon Valley talking to venture capital funds looking at the fact that if you exclude the social media the funding for innovation that venture capital raising Process is a fraction of where it was in the late 1990s during the height of the dot-com boom There was about 200 billion dollars raised By the VC funds in Silicon Valley. It's never gone above 25 billion since then And part of this is it is it owes to the fact that there's been a wall Streetization of the American economy patient capital is more difficult to raise and talk to anybody outside the social media sector in biotech and Robotics, it's very hard to get startup money Nowadays in in Silicon Valley or at least non angel investor money And I think that's an important and underappreciated point a couple of a couple of riders to that point If you look at the American trade deficit Which is back on the rise again? There's a massive massive deficit there in advanced manufacturing products It used to be zero in the mid 1990s and now we're up to a hundred billion dollars a year That's a big big deficit and I think The flow of research and development It's still three to one out of America than into America. These are the kinds of brain Cerebral activities that the models the economic models told us in the 90s America would monopolize During this new brave new globalization period America would be the brain American like Minded countries would be the brain and others would be the hand and it's not really working like that at all according to how the models would project and the final point is an intellectual crisis and I don't by this mean the constitutional fundamentalism of the tea party the problems with an intransigent Republican party. These are real By this I mean the much broader intellectual crisis That includes in particular I think economists and and what The challenges America faces pose as challenges to their world view the Models didn't particularly work the efficient market hypothesis Didn't really describe what we saw before us in the build-up to the 08 meltdown And yet they haven't been revised to nearly the degree that I think the paradigm hasn't Been upgraded or changed to nearly the degree that you know 708 people might have been anticipating The models told us that productivity growth leads to wage growth Which of course they haven't the models told us that when China joined the WTO in in 2000 that the trade deficit with China would shrink rather than explode And the models today are telling us that if we pump Simply pump demand back into the economy We will get back to the status quo ante We will get back to a well-functioning market system and that that pre-existed the 0708 meltdown In the last few months we've seen 200,000 jobs also created a month a little bit lower last month But these jobs are coming at lower wages These jobs are coming with falling incomes. The market is clearing at a lower price Not a higher price and that is a deeply rooted structural problem that these models don't answer So I think to some extent America has lost a paradigm and not yet found a new one. I'll conclude not by trying to be too uplifting but by By making the point that a Lot of people look at America's relative economic decline and either deny it's happening or deny it's important I think it's actually a product partly of America's success That we're seeing in China or India that the global commons has been sustained by the United States These are larger markets for American exporters. It should be a virtuous circle that we're seeing here but to deny that there is relative decline and that these are Accompanied by very great challenges to the way America lives and works through globalization through technology Is I think as I say an ostrich-like position and I've heard a lot of people recently Say in various quarters on interviews and in public fora But America always gets through these crisis look at the challenges posed by Nazism By Stalin in the Cold War the civil rights era the Great Depression We get through these challenges and America has and it did remarkably well And if it hadn't the 20th century would have been a dark century for everybody But these are very different kinds of challenges to the ones that are being posed now They unified America when Nazi Germany declared war on the US it unified America instantly The challenges posed today are dividing America and making it very very difficult for for America to respond with with the kind of Gravitas that I think Washington ought to be exhibiting but shows no signs of Exhibiting and then finally very very finally. I promise because I know I've overshot Is that these people who are saying we've made it through before? Are also denying there is a crisis So if you deny there's a crisis, however slow burning it might be How can you come up with solutions to it? That would be the non uplifting question. I would leave it with but since we'll be Continuing on and sit over there Well, Ed, thank you very much as expected. I was very incisive and also rather sobering in so why don't we take off for a few minutes from where you left off in In an overall sense one gets from your book a Real appreciation of the complexity and magnitude of the challenge the United States faces What I don't yet fully comprehend is How you and the final analysis down deep in your gut feel about what all of that implies Ultimately forced to the wall if threatened with getting shot if you don't provide an answer and Told that if in the next several years the answers proven to be false The person will come back and shoot you What would you say about the prospects of the United States? given the whole Complex of issues that we now confront. I would say America will ultimately change its political course that something has to give This situation isn't sustainable. My fear is it has more to run and Time is short things are changing really very very rapidly around the world have to give What will have to give I think first and foremost now should be you know as a practice journalist Less accented in this answer but I do think that when one of the two major parties in a system that is designed only to work well when they are cooperating when the factions are the some fluidity up there on Capitol Hill that when one of the two major parties is in a position of denying evidence and science Reasonable debate it makes it very very hard and and possesses the tools to stymie When they're in the minorities as they are in the Senate still to stymie any meaningful action Then you see a California is Asian. I spoke of the Latin American Isation then you see a California is Asian people tell me that in California after the latest census We might get to a position where What is essentially the Anglo party the Republican party is below a third and therefore can't stop stuff from happening But we're we're nowhere near the situation where the Republicans are being forced nationally to recalibrate From I think this is very impractical and very un-Republican stance that they've adopted in the last few years That's that would be my number one. Well now in the course of your journeys around the United States Really somewhat on the dead talk you will model What is your sort of intuitive sense as to the source of this inadequacy of one of the two political parties? Is it some sort of deeply rooted prejudice? Is it escapism from the world? Is it an adequate education? Is it some sudden? Economic socioeconomic travails What creates this special source of paralysis? I mean I think every political culture has traits in its past that it Returns to in a situation that I think the American first well the no-nothing movement the Shays and whiskey rebellions. There's a deep anti anti-elite and anti-intellectual Electual strand in American history that you can understand That is very much part of the political DNA here So there is that to reach to reach for in times like this But there is also I think a very interesting demographic Change happening in America That Ronald Brownstein really at the journalist of the National Journal really really captures well when he writes And that is that in places like Texas and already in California the white Blue-collar classes the non-college educated whites are becoming a minority. They're not particularly served well They are part of the middle class to the mass socioeconomic phenomenon they are squeezed and And They're reacting by reaching for this part of America's political DNA. I do think you know Texas majority of people in Americans Texan schools are now Hispanic. It just went over 50 percent last year And the Republican Party is faced with a real challenge that gradually Election after election that share of the electorate is going to get higher and higher at some stage something has to give They can't keep willfully losing potential voters without changing changing their course. So that's that's a source of hope But not yet a prediction now this parochialism of American society, which you also imply What is it rooted in is it some sort of a hankering for a past that never really existed? Is it a self-imposed? Isolation in in a time in which the world is more interwoven and more interconnected than ever before is It's some basic failure of the American educational system to create a public that is more in tune with what's happening in the world Where would you point to us the cause of this malaise? I mean I think out even people do blame Washington They make a fetish out of Washington as if it sort of exists apart from them and I do think Washington is to some extent the Washington America deserves at the moment if you look at who participates in politics It's increasingly For primary elections and it's increasingly party activists. How often do the people who complain about that actually participate? I think if you look at spending in a place like California where people do through the ballot initiative Have direct control and have and have tied up their legislature in Sacramento in bounded hand and foot They vote for contradictory things the whole time One example of which is the three strikes on your outlaw The initiative in the in the mid 90s, which now half of American states have which explains a great deal of white American spending on Prisons which of course bought Tocqueville over here in the first place a study of prisons Has outstripped spending on higher education by a factor of six in the last 15 years in America This is spending on yesterday not spending on tomorrow the budget for tomorrow Keeps getting cut and of course that applies writ large to the federal budget. Look at the bit that's been frozen It's the it's a discretionary the domestic discretionary non-defense portion now defense has also been hit But all the yesterday items How much of this sort of disappointment with the government is conditioned of inadequate government in Washington Is the byproduct of this extraordinary? Incumbency the duration of incumbency the fact that most legislators are here to stay Relatively if you get replaced in the actual process Corrupt and the connection of that to corruption of money of the American political process I was just looking right now at your index to look at the word corruption And then I realized there's no index here. We deliberately excluded the Washington read That was that was a chapter excluded It was I can't remember was Reagan or Nixon who said that fewer elect You get a bigger turn over with the elections to the Soviet Presidium right then I think that's part of it. I think though that the gerrymandering you see in districts Isn't isn't the explanation you would use for the Senate whether no boundary changing is possible and yet the Senate is just as polarized I would point more towards people like On the left or left ish bill Bishop the big sort Or on the right Charles Murray people who've analyzed how Americans are sorting themselves into completely different worlds and that the super zips Zip codes that Charles Murray talks about are bordered by slightly less super zips and so on and the distance between Americans and how they experience the world not just the media they listen to Or the way they vote is become way greater than it used to be That that's part of the Latin Americanization phenomenon I feel another aspect of it is that the popularly elected elite in Congress, but also in the executive branch is Overwhelmingly representative of the 1% you talk about that's absolutely right The role of money in politics. I mean we talk talk about how Washington's got dysfunctional I don't know whether the Supreme Court should or shouldn't be included in that but it does listening to the arguments the other day Regardless of what your view is whether you're pro or against Obamacare you hear basically eight eight people for each on party line questioning and one swing vote Which I guess is Obama's coming Kennedy moment just as Kennedy moment That's the Degree to which Washington is even the Supreme Court the public Public opinion polls show it plummeting not just After the 2000 gall versus Bush ruling but in the last ten years steadily going down not to as low as Congress is or the presidency but Lower than it's ever been and I think this again reflects the feeling that Washington is out of touch And and very disconnected from the average American great one final question for me in how do you envisage? the impact of the outside world on the United States in this context is it going to facilitate the needed response or it's going to make it more difficult to mount The outside world and in terms of shocks I mean you could think of you know the Spanish bomb going off in the next few months or the straight of Hormuz Being blockade Iran. Yeah, I do you mean in that respect but also the rise of China I think there are some Rabbit in the world. I see yeah, no, I think that's a good question I think there's some paradoxical short-term effects of this America seeks to sustain its global footprint and its bases around the world China only seeks to extend its area of denial in its own region. So there's a big asymmetry of rivalry there It's easier for China to do what it can do than America to sustain what it has but in the short term that's obviously made China's neighbors very nervous and I think has actually increased America's clout in the region and I think improved its Leverage in the short term at some stage though, that's in the world But what about within the United States regarding the problems that you've been addressing is it likely to contribute to revitalization? out of a sense of threat or More passive resignation and difference and ignorance which will prevent the needed response And one of the things I deal with in my book is the fact that there's a lot of apathetic people out there I can understand why they're why they're apathetic I can understand that the market system in votes isn't isn't working like a market should do if the consumer is the voter People's frustrations are not being heard or felt or reflected in what Washington is doing I Don't know what is going to change that Because if you are and I'd quote and speak to Jeff Immelt for this book he makes the point I think nobody would disagree with that if globalization were put to a referendum in America It would lose absolutely rejected. It would be rejected, but those You know those are sort of gradually It's sort of frog in frog in boiling water analogy. This is this isn't like Nazi Germany declaring war on you This is a slow structural Set of complex problems that are very hard to produce a unified solution Well, I think it's time to let the audience have a crack at you. So will you now? Spot people recognize that absolutely. Yes. Do you want to go down or so you could stay here? I think we're higher up here than down there I'm Harlan omen. My question is both for you Ed and also you's big I would counter your argument by saying that the issue was not economic But we have a political process that's badly broken because politics are no longer about governance They're about getting elected and doing the worst things to the other side and both political parties have become So radicalized by the left and right that compromises out having said that I Remember the 70s when Zbigg became national advice security advisor terribly well when the situation was really very very bad We had lost Vietnam the oil and bar go Nixon resigned all these kinds of things desert one and the nation really was in a spirit of malaise inflation and Unemployment and the misery index was running high. Tell me why then was not as bad as today and Even though you're very pessimistic about today, and I take your arguments about a broken government I think that's a big distinction But tell me why we were able to recover in the late 70s and why you think we're not going to be able to recover today Because I think from a psychological position this country was probably worse off than than I think it's a very good question The country knew that it was in crisis. It wasn't responding in a unified way But if you look at the kinds of things that were done under Reagan Pragmatic things as well as Carter, but let's move on to Reagan because it makes my point more strongly And under Carter mean that the by-dole act that bought the university system Into the innovation it made it much easier for universities to fund innovation because they could keep a share of the gains a Beautifully pragmatic thing to do which had a big impact on American innovation If you look at the tax reform of the 80s the simplification of the code if you look at the Greenspan Commission How social security was dealt with then if you look at sematech the creation under sustained assault from Japan The semiconductor industry which the Reagan administration agreed was an absolutely critical strategic industry Even the Reagan administration agreed to industrial policy and look at immigration reform I think Jim Mann is here very and Jim would be able to Elaborate on this at much greater length, but the fact is it was understood there was a crisis It was understood the model had run out of a lot of its usefulness and measures were taken to respond to that Where where is that now? Some people don't even agree that there is a crisis Where is that now? I think the political system is Degenerated a lot further and if you use purely political measures of polarization. I mean voting measures of polarization You will see that it's far more polarized and therefore far more paralyzed Today than it was then and I don't as I say I would emphasize I don't see Washington as somehow existing a part suspended from the society that produces it and sustains it I think it does reflect stuff that's going on out there that is very deeply rooted very structural And it's about the changing nature of the economy in America in the context of a changing global economy That would be my answer but speak Well, I basically agree with you. It seems to me that The crisis in the sort of 70s was a crisis which was occurring in the context Still of a very lethal potentially lethal rivalry with the outside world and that Was a source also of stimulus to internal responses And in any case it wasn't yet a crisis that it was pervasive culturally socioeconomically as it is today in some ways the victory The sort of historical victory in the great contest that took place at the end of the 80s and early 90s Then produced a period in the United States really of significant permissiveness deregulation and Of what you emphasize in your book But in my view perhaps needs to be emphasized even more the growing social disparities between the rich and the poor All of that really emerged in the last 20 years Yes, see we're good Thank you, Paolo from Shirak Shirak report just also in terms of sort of historic continuum that you Portrayed in your in your earlier remarks a question as you have clearly indicated the share of US Prod you know GDP world GDP has shrunk more than it is Officially admitted at least you know in you know, bioficial economists My question is the Clinton years which are portrayed, you know, supercharged America things were going great And of course we can account for some particular historic circumstances the end of the Cold War the peace dividend the cutting down of you know The ability to cut down defense spending no major crisis barring Bosnia or Kosovo that the Clinton administration had to deal with Oil at $20 a barrel as opposed to what we have today And of course the internet revolution that happened not really much had much to do with Washington policy But it was happening and control of public spending with agreement with the Republican Congress after the 94 elections my question to you is was just that again just a blip in in what was Inevitably a downward trend that we had a moment of glory for the United States There was due to just lucky circumstances that then indeed when Clinton left the White House We had the dot-com bust in 2000 and we had that nine, you know the the major scandals the MCI the adult The big Wall Street scandals and then last but not least 9-11 and everything that followed in other words Where the Clinton years times in which we were doing the right things We were just lucky in in what was inevitably a downward trend that is you know that is continuing as you described And and one final point is you have not at least in Europe a brief remarks addressed Public spending much, you know, you talked about economic trends, but certainly our fiscal situation Is has become a really a significant part of the problem given the weight of entitlements You just briefly mentioned, you know the compression of our non-defense discretion Discretionary spending if you could talk about that too. Thank you. I mean, I think you're there was a one-off Hopefully not the only one off But there was a one-off major major positive supply shock in the 1990s namely the internet revolution and actually that the personal computer revolution that have preceded it and this had a major impact on America's bottom line into and and on its productivity Broke productivity picked up and it'd been languishing for 20 years and it picked up I Think the stewardship of the economy broadly speaking under the Clinton administration and Bob Rubin Larry Summers and others Was very responsible and it was namely it was the Kensian full cycle Kensian view Which is during an upturn and when revenues are surging you go into budget surplus so that you have funds and firepower to keep for a rainy day The trends were there's a brief five-year blip there basically in the median median wage stagnation problem Where wages do grow for the vast majority of the workforce in the 90s So there was good stewardship, but I don't think that's nearly as important a point as the impact of The one-off positive supply shock which we can't rely on happening again In terms of the fiscal picture Well, I guess that leads on your second question leads on from my answer to the first because of course that Balanced the budget over the cycle Golden rule was dispensed with by the Bush administration It squandered a lot of money on tax cuts for people who had already in the 90s at their pre-existing tax rates being creating a lot of jobs and being creating a lot of wealth on on on the notion that these are the job creators and So we do find ourselves in a situation adding a couple of wars adding interest on past due debt Where as I said in an earlier answer We've got 85% of the budget Given to entitlements defense and interest payments on past due debt and the tomorrow bit of the budget that includes R&D Infrastructure education that 15% portion of the budget is the first one. Everybody can agree on to freeze Now what does that say about that the changing political climate that the pragmatism? That America is so richly deservedly associated with is missing in action And I think the budget is a really good If you had another implied question about the need to have a fiscal term medium term plan I would agree with that. I think we're in Washington. We know we know more than enough about that subject Just as a follow-up to your answer. How do you feel? the possibility the consequence How do you assess the possible consequences of America's involvement in a conflict with Iran on this sort of overall Domestic condition and the mood of the country. I I should have asked you that question and you should now Do it How do I how do I assess the impact of a conflict of an Israeli strike on Iran? Well, none of America involved in it America's involvement and then it becomes which would lead to it on The mood of the country and its capacity to address some of these issues before or after the election Well depends when the strike occurs two days before the election or three weeks before or what? I would but seriously in terms of the overall impact of the Reasonably anticipated consequences. I think that's very hard to say I mean the opinion polls show large not large a small majority rather of people would support Military action in some contexts to prevent Iran from getting a nuclear weapon So it's not it's not axiomatic that this would necessarily be unpopular for Americans initially initially and I think very quickly this would turn into An anti-arrival sentiment squared because people are sick of war. They do want focus on the domestic problems They're not as terrified by the 9-11 kind of scenarios as they used to be And so my my assumption based on no evidence whatsoever other than a couple of stray opinion polls that are in my head is That it wouldn't it wouldn't be sustainably popular But I would I would I would pass me to the euro would it galvanize a greater inclination to deal with domestic problems Or would it contribute to greater fracturing of any residual national unity? I think you judge me I mean if you look at the kinds of hostage to fortune Mitt Romney has made on the campaign trail on this issue They're not they're not in the ambivalent language that will make it easy for him to wriggle out of if he becomes president Even President Obama has made pretty strong commitments that that containing Iran is not an option So, you know, I I do worry this could be I mean this would not do worry This would be a very fissile and divisive political issue because I doubt I Doubt most of the I doubt a large chunk of the American people would think this was a good idea at all I Jim man, I Let me ask you to square two things that I have a hard time reconciling in my own mind, which is when I Listen to my friends say that the country is going to the dogs or when I come to that conclusion myself, which usually involves some Some something involving the transportation system the roads or airports of this country And I draw that tentative conclusion, and then I happen to go into an Apple store And see the part of the country that's working and this is on getting away from the anecdotal level a country with a company that is Terrifically profitable and is able to shell out in the last a couple of days a billion dollars to 12 kids getting out of Four kids, I guess just getting out of Stanford to buy their company. You have this tremendously productive Part of the economy. How does it fit in? Is it isolated? Is it linked? Why doesn't that part of the economy? flow over and Down and around it's a very good question. Did you mean the Instagram the Facebook acquisition? Yeah, the There are I don't know whether you know Tyler Cowan's book the great stagnation. He's not talking about middle-class incomes He's talking about the innovation revolution, and I think there are two two points worth making here Steve Jobs was a genius, and he was an innovative genius, and there's no downplaying that But I think that Tyler Cowan's points that we are picking the low-hanging fruit of the internet revolution The social media bit is a particularly low-hanging fruit now And that that broad productivity gains that you've got from big leaps in former stages of American history for example the introduction of mass education to go from Semi-literate illiterate society to literate what an enormous leap in America's innovative potential To go from having a central government that had no R&D Funding and no R&D capacity to one that has DARPA and the NIH these were huge breakthroughs, and then of course the Unification of a national economy. We're not getting those kinds of easy opportunities now to lift American growth and You have in Silicon Valley all sorts of Really impressive companies still very impressive companies and some yet to be impressive companies of no doubt about that But if you look at the infrastructure around it and the impact of the infrastructure around it on Silicon Valley And you look at the history of Silicon Valley and how it benefited from the government largest through the research laboratories through the contracts and through the making available lots of highly educated foreigners on easy visas Then lots of these things are changing. I mean the the last in particular I think most reasonable people on left and right would agree a staple act Where you staple a green card to the visa of this Chinese PhD student or Indian PhD student is Common sense the kind of pragmatic thing that Washington would have done in the 1950s 60s if you look at the Fact that venture capital funds are much more run by X investment bankers nowadays rather than people who used to run Companies the character of the seas have changed dramatically if you look at the fact that Sequoia capital if you you know one of the best Has eight offices around the world of only of which only one is in the United States It's not because opportunity necessarily is shrinking here, but there are all sorts of entrepreneurial Innovative opportunities arising elsewhere. So my point isn't really to knock down America's innovative potential I mean, I don't think there's a culture in the world Where you go bankrupt and boast about it like you do in America and that's a really healthy thing But I do think that America's period of total unrivaled Lead in innovation is very much becoming a thing of the past others are beginning to innovate I don't think China is going to produce an apple or It's got its own Twitter, of course, but that's a copy or or a Facebook But I do think if you look at the kinds of money That governments in East Asia and elsewhere are putting into R&D and doing so in very pragmatic Collaborative arrangements with their private sectors as America did in the 50s 60s 70s as America did to create Silicon Valley that America is no longer alone on the stage of being an innovator. It's not a Get out of jail free card I guess that doesn't that doesn't fully answer your question, but The distribution while the tax system has changed But of course the production Silicon Valley only funds ideas now You don't get funding if your idea doesn't include a China strategy. You don't get funding if production is here I mean, that's that's the absolute basic first base template for going and seeking funding is it doesn't include in America Making things dimension to it please All the discussion seems to imply that the country is in bad need of some kind of shock I mean, you're implying that Iran could play that role, but it seems that it's much more of a domestic Lead and economic shock that the country needs to focus its mind on what is necessary Are we probably talking about something similar to what is just happening in Europe could that focus the mind of the people? suddenly Treasuries coming under pressure because markets start losing their confidence that the country can get a grip on its problems I mean, I hear that a lot and I understand why people say that is that you know Lehman Brothers wasn't enough it didn't shift the thinking sufficiently But I'd be careful what you wish for. I mean, you know shocks can produce diametrically wrong outcomes. I mean if you think of The McCarthyite Red Scare if you think of the invasion of Iraq shocks don't necessarily lead to good actions They do sometimes. I mean the 30s is of course a primary example of bold persistent experimentation Experimentation incidentally which included at its core what will happen to human beings? What are they going to do? How are we going to employ them? I feel we we conduct debates now slightly higher altitude And but that's a irrelevant to your question some kind of some kind of a jolt To the way people think about this is going to be necessary because this is a long process We're in it is something we gradually we're way more acclimatized to than we think we are Yes, I'm sleepwalking is another word I use and of course that would imply Somebody you know giving you a prod or electric shock But I would I would hate to what wish for a shot You know Hurricane Katrina times five or whatever it might be that people in the environmental movement wish for to shock America and others back to Warming sensibility. I would hate to wish for that equivalent in the broader geopolitical competitiveness space I'm talking about because I dread to think I dread to think what it might be and whether it would induce the right Rethinking I think people have got to do it themselves One more Sorry Sitting sitting just here Two microphones a duet duet to the back Tom man's back To what extent do you think that this is Precipitated by the rush to the bottom line That our industry no longer looks to the future looks to the next quarter All you have to do is look at how the drug industry has changed it buys new companies. It doesn't do any research itself It goes to China. It doesn't think about long-term stuff. I Wonder how NAFTA fits into that Much more complicated, but I'm most interested in the rush to the bottom line and the role of Wall Street and all this It's a very good question. I mean one of the numbers that That is often cited is that the American private sector Spends I'm not sure whether I'm a year out of date now, but spent last the last year I remember the number for three hundred and thirty billion dollars on research and development a lot of money And that's bigger, you know than the R&D government budgets of many of the big Asian countries way bigger But if you look at what this involved a lot of it is Routinized bureaucratic activity. This isn't basic research. This isn't scientific research and Alcatel which took over Bell Labs when it took over 80 that bit of AT&T Recently converted Bell Labs into a normal corporate R&D center and we won't be hearing anything from it for again I don't think because that's not what normal corporate R&D is about So the basic sort of serendipitous research that produces breakthroughs is not what most corporate R&D is going to The reason for that is because the time horizons The Bell Labs hat that they had to make all the amazing Nobel Prize winning breakthroughs They made in the 60s 70s Just don't exist for a normal corporation the pressure to justify You know spending 200 million dollars on something that might five ten years from now Produce a breakthrough only the pharmaceutical sector can do and as you've pointed out It's changed its strategy, which is now to gobble up small companies is basically it's a boa constrictor and it swallows things And these small companies don't go to market anymore. They don't have IPOs these VC funded biotech companies Are created expressly with the purpose of being acquired and the acquisition kills the entrepreneurialism straight away It's the lot of this is under the radar and a lot of this is what my book addresses But your question is absolutely right I think it's it's um, you are you're putting your thumb on a very important problem with the time horizons most of Corporate America not all of corporate America, but most of it Well, I'm sorry that time doesn't permit us to accommodate everyone who has signaled that they would like to raise an issue But let me say simply in thanking Ed for this incisive discussion That I think he has demonstrated to us very effectively the correctness of his title time to start thinking This was very much part of that. Thank you very much indeed There are refreshments and I'm take it you're going you're willing to mingle so absolutely yes Let me turn this off. Thank you. It was really good. Well, I'm delighted to do it. It's really good. It was a good session


My one thing is resealing plastic bags for maximum freshness. So unless you're extremely hungry or the member of a large family, chances are you're not going to consume the entire contents of a chip bag, a pasta bag, or a bag of rice all at once. So you're left with a problem, right? How do I maintain the freshness of my food? The thing is, chip clips don't work that well. What happens with a chip clip is that you have two gaps where air can get in. This popcorn, still within days, I promise. Unless, of course, you use our method. All you need to do this is a lighter, a ruler.  Now you're going to line up this edge with the table edge and now you're going to use your lighter. Don't be afraid to use the flame. It's not that scary and it all happens really quickly because fire melts plastic. I'm going to guide the flame along the edge of the ruler and I can sort of see the melting happening in action. It happens super quickly, like I said. I mean, that's pretty cool, if you ask me.  It also works for things like bags of rice and pasta. I'm gonna show you just how that works here. You remove the excess air as best you can. You place the ruler on the bag.  Remember what we said about moving quickly? It doesn't take long for the flame to melt the plastic to a point that you have a really tight seal that's not going to let any air in. Remember, the objective is maintaining freshness so you wanna keep air out. Look at this. It's pretty cool. The next time you're craving popcorn, you can open it up knowing that it won't be still. For more fresh tips, check out our One Thing video series.