Post on 13-Jan-2016
description
transcript
Base Operating System Services CLR
Transactions Storage
Protocols
Network Services
Kern
el Mo
de
Base Class LibrariesBase Class Libraries
Memory ManagerMemory Manager
Hosting LayerHosting Layer
Code ExecutionCode Execution LoaderLoader SecuritySecurity SerializationSerialization
LightweightTransactionsLightweightTransactions
TransactionCoordinatorTransactionCoordinator
KernelTransactionManager
KernelTransactionManager
LoggingServiceLoggingService
KernelKernel
Hardware Abstraction LayerHardware Abstraction Layer
ProcessManagerProcessManager
SecurityReference Monitor
SecurityReference Monitor
LPCFacilityLPCFacility
MemoryManagerMemoryManager
PowerManagerPowerManager
ConfigManagerConfigManager
Plug andPlayPlug andPlay
TransactedNTFSTransactedNTFS
Cache ManagerCache
ManagerUniversalData Format
UniversalData Format
FilterEngineFilterEngine
TPC, UDPIPV4, IPV6TPC, UDPIPV4, IPV6 IPSECIPSEC QOSQOS HTTP
ListenerHTTPListener
Internet Connection FirewallInternet Connection Firewall
Demand Activation and Protocol HealthDemand Activation and Protocol Health
PNRPPNRP NativeWiFiNativeWiFi SIPSIP TCP
ListenerTCP Listener
UDP ListenerUDP Listener
IPC ListenerIPC Listener
Network Class LibraryNetwork Class Library
GDI/GDI+GDI/GDI+ WindowManagerWindowManager
GlobalAudio Engine
GlobalAudio Engine
DirectXGraphicsDirectXGraphics
Graphics driversGraphics drivers
DDIDDI InputManagerInputManager
AudioDriversAudioDrivers
DirectX GraphicsMini port
DirectX GraphicsMini port
RedirectorsRedirectors
SCSI/FCSCSI/FC 802.3802.3 802.11802.11 ....
Device Drivers
ManagementManagement
Presentation Data Communication
WinFS Indigo
Make the connection
Windows FormsAvalon ASP.NET
ObjectSpacesObjectSpaces
DataSetDataSet
SQL XMLSQL XML
ProvidersProviders
Fram
ewo
rk
ServicesSchemas
Data Model
ADO.NET
Connectivity
Synchronization(WinFS, Win32..)Synchronization(WinFS, Win32..)
InfoAgent(PreferenceRules..)InfoAgent(PreferenceRules..)
FileSystem Services(MetaDataHandlers..)FileSystem Services(MetaDataHandlers..)
CalendarCalendar MediaMedia
DocumentDocument ……
ItemsItems
RelationshipsRelationships
ExtensionsExtensionsCommunications Manager (Port)Communications Manager (Port)
Messaging Services
Transport Channels(IPC, HTTP, TCP…)Transport Channels(IPC, HTTP, TCP…)
IO ManagerIO Manager
Channels (Datagram, Reliable, Peer, …)
Channels (Datagram, Reliable, Peer, …)
Policy EnginePolicy Engine
MessageEncoderMessageEncoder
ChannelSecurityChannelSecurity
QueuingQueuing
EventingEventing
RoutingRouting
TransactionTransaction
Desktop ServicesDesktop Services
Desktop WindowManagerDesktop WindowManager
Presentation Object ManagerPresentation Object Manager
Desktop Composition EngineDesktop Composition Engine
Animation andCompositionAnimation andComposition
Media Services
Hardware RenderingHardware Rendering
MediaProcessingMediaProcessing
Capture and SourcingCapture and Sourcing
Software Renderingand SinksSoftware Renderingand Sinks
Adaptive UIEngineAdaptive UIEngine
Page/SiteCompositionPage/SiteComposition
Personalization andProfiling ServicesPersonalization andProfiling Services
Membership and Security ServicesMembership and Security Services
Designer ServicesDesigner Services
Controls Interop EngineControls Interop Engine
ControlsControls
Windows Forms
ApplicationServicesApplicationServices
Application DeploymentEngine (Click-Once)
Application DeploymentEngine (Click-Once)
PeoplePeople GroupGroup
Identity &SecuritySystem
Identity &SecuritySystem
Collaboration
People andGroupsPeople andGroups
CollaborationHistoryCollaborationHistory
Real-TimeActivitiesReal-TimeActivities
SignalingSignalingFederationFederation
System Services
FAT 16/32FAT 16/32
FilterManagerFilterManager
DistributedFile SystemDistributedFile System
Backup /RestoreBackup /Restore
File ReplicationServiceFile ReplicationService
Virtual DiskServiceVirtual DiskService
Mo
dels
ServiceServiceObjectObject T/SQLT/SQL XMLXMLDocumentDocument UIUI MediaMedia
2
The Service-Oriented ModelServices, Clients, Systems
Tenet: Boundaries are ExplicitTenet: Services are autonomousTenet: Share Schema, not Class
Connector
Communications Manager (Port)Communications Manager (Port)
Transport Channels(IPC, HTTP, TCP…)Transport Channels(IPC, HTTP, TCP…)
Channels (Datagram, Reliable, Peer, …)Channels (Datagram, Reliable, Peer, …)
Policy EnginePolicy Engine
MessageEncoderMessageEncoder
ChannelSecurityChannelSecurity
Service Model
Hosting Environments
Instance ManagerInstance Manager
Context ManagerContext Manager
TypeIntegrationTypeIntegration
ServiceMethodsServiceMethods
DeclarativeBehaviorsDeclarativeBehaviors
TransactedMethodsTransactedMethods
ASP.NETASP.NET .container.container.exe.exe NT ServiceNT ServiceDllHostDllHost
Messaging Services
System Services
QueuingQueuing
RoutingRouting
EventingEventing
……
Transaction Transaction
Federation Federation
……
Indigo ArchitectureIndigo Architecture
4
“Indigo” And Transactions
Map
WinFSStore
Objects are added to change list as app. makes changesItemContext.Update saves changes back to storeIf another application has modified data a “change collision” event is raised
Objects are added to change list as app. makes changesItemContext.Update saves changes back to storeIf another application has modified data a “change collision” event is raised
The Change ListThe Change List
UpdateUpdate ID = 1, Remove ID = 2, Create ID = 3, ...
Modified
Removed
Added
Remove
Modify
Add
ItemContext
ApplicationChangeCollisionEvent
ID=1
ID=2
ID=3
Ch
an
ge
List
Longhorn ApplicationLonghorn Application
Relationship ExamplesRelationship Examples/
Id: 0
FolderId: 1
ContactId: 2
ContactId: 3
FolderId: 10
ContactId: 11
Document Id: 12
ImageId: 15
DocumentId: 16
ImageId: 20
YourFolderMyFolder
C1C2 C3 D1C4
Document Id: 30
D2
ImageId: 21
Reference
Embedding
Holding
Support Your Garbage CollectorSupport Your Garbage Collector
Use an efficient “allocation profile”Short lived objects are cheap (but not free)Don’t have a “midlife crisis” (churn gen2)Review with perfmon counters, CLR Profiler
Avoid common GC pitfallsKeeping refs to “dead” object graphs
A subtle problem, as old as the hills
Implicit boxingPinning young objectsGC.Collect considered harmfulFinalization ...
Use an efficient “allocation profile”Short lived objects are cheap (but not free)Don’t have a “midlife crisis” (churn gen2)Review with perfmon counters, CLR Profiler
Avoid common GC pitfallsKeeping refs to “dead” object graphs
A subtle problem, as old as the hills
Implicit boxingPinning young objectsGC.Collect considered harmfulFinalization ...
Compilation ModesCompilation Modes
Compilation ModesCompilation Modes
Compilation ModesCompilation Modes
Compilation ModesCompilation Modes
Compilation ModesCompilation Modes
Cleanup: Less Code, More ControlCleanup: Less Code, More Control
The CLR state of the art is great for memoryIt’s not great for other resource types:
Having lots of finalizers doesn’t scale, and usually the finalizer is run too late. Examples: files, database connections, locksThe Dispose pattern (try-finally, or C# “using”) tries to address this, but is fragile, error-prone, and requires the user to write more code
Instead of writing try-finally or using blocks:Users can leverage a destructor. The C++ compiler generates all the Dispose code automatically, including chaining calls to Dispose. (There is no Dispose pattern)Types authored in C++ are naturally usable in other languages, and vice versaC++ choice: Correctness by default, speed by choice.(Other langs: Speed by default, correctness by choice)
The CLR state of the art is great for memoryIt’s not great for other resource types:
Having lots of finalizers doesn’t scale, and usually the finalizer is run too late. Examples: files, database connections, locksThe Dispose pattern (try-finally, or C# “using”) tries to address this, but is fragile, error-prone, and requires the user to write more code
Instead of writing try-finally or using blocks:Users can leverage a destructor. The C++ compiler generates all the Dispose code automatically, including chaining calls to Dispose. (There is no Dispose pattern)Types authored in C++ are naturally usable in other languages, and vice versaC++ choice: Correctness by default, speed by choice.(Other langs: Speed by default, correctness by choice)
Sidebar tilesSidebar tiles
Peripheral awarenessLive dataMinimal controlsUser controls which tiles appear and whereConsumes valuable screen real estate — make the tile worth it!
Peripheral awarenessLive dataMinimal controlsUser controls which tiles appear and whereConsumes valuable screen real estate — make the tile worth it!