分布式系统原理与范型 课后答案

分布式系统原理与范型 课后答案
分布式系统原理与范型 课后答案

DISTRIBUTED SYSTEMS PRINCIPLES AND PARADIGMS PROBLEM SOLUTIONS ANDREW S.TANENBAUM MAARTEN VAN STEEN Vrije Universiteit Amsterdam,The Netherlands PRENTICE HALL UPPER SADDLE RIVER,NJ 07458

w w w .k h d a w .c o m 课后答案网

SOLUTIONS TO CHAPTER 1PROBLEMS

1.Q:What is the role of middleware in a distributed system?A:To enhance the distribution transparency that is missing in network operat-ing systems.In other words,middleware aims at improving the single-system view that a distributed system should have.

2.Q:Explain what is meant by (distribution)transparency,and give examples of different types of transparency.A:Distribution transparency is the phenomenon by which distribution aspects in a system are hidden from users and applications.Examples include access transparency,location transparency,migration transparency,relocation tran-sparency,replication transparency,concurrency transparency,failure tran-sparency,and persistence transparency.

3.Q:Why is it sometimes so hard to hide the occurrence and recovery from failures in a distributed system?A:It is generally impossible to detect whether a server is actually down,or that it is simply slow in responding.Consequently,a system may have to report that a service is not available,although,in fact,the server is just slow.

4.Q:Why is it not always a good idea to aim at implementing the highest degree of transparency possible?A:Aiming at the highest degree of transparency may lead to a considerable loss of performance that users are not willing to accept.

5.Q:What is an open distributed system and what bene?ts does openness pro-vide?A:An open distributed system offers services according to clearly de?ned rules.An open system is capable of easily interoperating with other open sys-tems but also allows applications to be easily ported between different imple-mentations of the same system.

6.Q:Describe precisely what is meant by a scalable system.A:A system is scalable with respect to either its number of components,geo-graphical size,or number and size of administrative domains,if it can grow in one or more of these dimensions without an unacceptable loss of perfor-mance.

7.Q:Scalability can be achieved by applying different techniques.What are

these techniques?

A:Scaling can be achieved through distribution,replication,and caching.w w w .k h d a w .c o m 课后答案网

2PROBLEM SOLUTIONS FOR CHAPTER 1

8.Q:What is the difference between a multiprocessor and a multicomputer?A:In a multiprocessor,the CPUs have access to a shared main memory.There is no shared memory in multicomputer systems.In a multicomputer system,the CPUs can communicate only through message passing.9.Q:A multicomputer with 256CPUs is organized as a 16×16grid.What is the worst-case delay (in hops)that a message might have to take?

A:Assuming that routing is optimal,the longest optimal route is from one corner of the grid to the opposite corner.The length of this route is 30hops.If the end processors in a single row or column are connected to each other,the length becomes 15.

10.Q:Now consider a 256-CPU hypercube.What is the worst-case delay here,again in hops?A:With a 256-CPU hypercube,each node has a binary address,from 00000000to 11111111.A hop from one machine to another always involves changing a single bit in the address.Thus from 00000000to 00000001is one hop.From there to 00000011is another hop.In all,eight hops are needed.11.Q:What is the difference between a distributed operating system and a net-work operating system?A:A distributed operating system manages multiprocessors and homogene-ous multicomputers.A network operating system connects different indepen-dent computers that each have their own operating system so that users can easily use the services available on each computer.12.Q:Explain how microkernels can be used to organize an operating system in a client-server fashion.A:A microkernel can separate client applications from operating system ser-vices by enforcing each request to pass through the kernel.As a consequence,operating system services can be implemented by (perhaps different)user-level servers that run as ordinary processes.If the microkernel has networking capabilities,there is also no principal objection in placing those servers on remote machines (which run the same microkernel).13.Q:Explain the principal operation of a page-based distributed shared memory system.A:Page-based DSM makes use of the virtual memory capabilities of an operating system.Whenever an application addresses a memory location that

is currently not mapped into the current physical memory,a page fault occurs,giving the operating system control.The operating system can then locate the referred page,transfer its content over the network,and map it to physical memory.At that point,the application can continue.w w w .k h d a w .c o m 课后答案

PROBLEM SOLUTIONS FOR CHAPTER 13

14.Q:What is the reason for developing distributed shared memory systems?What do you see as the main problem hindering ef ?cient implementations?A:The main reason is that writing parallel and distributed programs based on message-passing primitives is much harder than being able to use shared memory for communication.Ef ?ciency of DSM systems is hindered by the fact,no matter what you do,page transfers across the network need to take place.If pages are shared by different processors,it is quite easy to get into a state similar to thrashing in virtual memory systems.In the end,DSM sys-tems can never be faster than message-passing solutions,and will generally be slower due to the overhead incurred by keeping track of where pages are.15.Q:Explain what false sharing is in distributed shared memory systems.What possible solutions do you see?A:False sharing happens when data belonging to two different and indepen-dent processes (possibly on different machines)are mapped onto the same logical page.The effect is that the page is swapped between the two processes,leading to an implicit and unnecessary dependency.Solutions include making pages smaller or prohibiting independent processes to share a page.16.Q:An experimental ?le server is up 3/4of the time and down 1/4of the time,due to bugs.How many times does this ?le server have to be replicated to give an availability of at least 99%?A:With k being the number of servers,we have that (1/4)k <0.01,expressing that the worst situation,when all servers are down,should happen at most 1/100of the time.This gives us k =4.17.Q:What is a three-tiered client-server architecture?A:A three-tiered client-server architecture consists of three logical layers,where each layer is,in principle,implemented at a separate machine.The highest layer consists of a client user interface,the middle layer contains the actual application,and the lowest layer implements the data that are being used.18.Q:What is the difference between a vertical distribution and a horizontal dis-tribution?A:Vertical distribution refers to the distribution of the different layers in a multitiered architectures across multiple machines.In principle,each layer is implemented on a different machine.Horizontal distribution deals with the distribution of a single layer across multiple machines,such as distributing a

single database.

19.Q:Consider a chain of processes P 1,P 2,...,P n implementing a multitiered

client-server architecture.Process P i is client of process P i +1,and P i will return a reply to P i ?1only after receiving a reply from P i +1.What are the w w w .k h d a w .c o m 课后答案

4PROBLEM SOLUTIONS FOR CHAPTER 1

main problems with this organization when taking a look at the request-reply performance at process P 1?A:Performance can be expected to be bad for large n .The problem is that each communication between two successive layers is,in principle,between two different machines.Consequently,the performance between P 1and P 2may also be determined by n ?2request-reply interactions between the other layers.Another problem is that if one machine in the chain performs badly or is even temporarily unreachable,then this will immediately degrade the per-formance at the highest level.w w w .k h d a w .c o m 课后答案

5

SOLUTIONS TO CHAPTER 2PROBLEMS

1.Q:In many layered protocols,each layer has its own header.Surely it would be more ef ?cient to have a single header at the front of each message with all the control in it than all these separate headers.Why is this not done?A:Each layer must be independent of the other ones.The data passed from layer k +1down to layer k contains both header and data,but layer k cannot tell which is which.Having a single big header that all the layers could read and write would destroy this transparency and make changes in the protocol of one layer visible to other layers.This is undesirable.

2.Q:Why are transport-level communication services often inappropriate for building distributed applications?A:They hardly offer distribution transparency meaning that application developers are required to pay signi ?cant attention to implementing commun-ication,often leading to proprietary solutions.The effect is that distributed applications,for example,built directly on top of sockets are dif ?cult to port and to interoperate with other applications.

3.Q:A reliable multicast service allows a sender to reliably pass messages to a collection of receivers.Does such a service belong to a middleware layer,or should it be part of a lower-level layer?A:In principle,a reliable multicast service could easily be part of the trans-port layer,or even the network layer.As an example,the unreliable IP multi-casting service is implemented in the network layer.However,because such services are currently not readily available,they are generally implemented using transport-level services,which automatically places them in the middleware.However,when taking scalability into account,it turns out that reliability can be guaranteed only if application requirements are considered.This is a strong argument for implementing such services at higher,less gen-eral layers.

4.Q:Consider a procedure incr with two integer parameters.The procedure adds one to each parameter.Now suppose that it is called with the same vari-able twice,for example,as incr (i ,i ).If i is initially 0,what value will it have afterward if call-by-reference is used?How about if copy/restore is used?A:If call by reference is used,a pointer to i is passed to incr .It will be incre-

mented two times,so the ?nal result will be two.However,with copy/restore,i will be passed by value twice,each value initially 0.Both will be incre-mented,so both will now be 1.Now both will be copied back,with the second copy overwriting the ?rst one.The ?nal value will be 1,not 2.w w w .k h d a w .c o m 课后答案

6PROBLEM SOLUTIONS FOR CHAPTER 2

5.Q:C has a construction called a union,in which a ?eld of a record (called a struct in C)can hold any one of several alternatives.At run time,there is no sure-?re way to tell which one is in there.Does this feature of C have any implications for remote procedure call?Explain your answer.A:If the runtime system cannot tell what type value is in the ?eld,it cannot marshal it correctly.Thus unions cannot be tolerated in an RPC system unless there is a tag ?eld that unambiguously tells what the variant ?eld holds.The tag ?eld must not be under user control.

6.Q:One way to handle parameter conversion in RPC systems is to have each machine send parameters in its native representation,with the other one doing the translation,if need be.The native system could be indicated by a code in the ?rst byte.However,since locating the ?rst byte in the ?rst word is pre-cisely the problem,can this actually work?A:First of all,when one computer sends byte 0,it always arrives in byte 0.Thus the destination computer can simply access byte 0(using a byte instruc-tion)and the code will be in it.It does not matter whether this is the low-order byte or the high-order byte.An alternative scheme is to put the code in all the bytes of the ?rst word.Then no matter which byte is examined,the code will be there.

7.Q:Assume a client calls an asynchronous RPC to a server,and subsequently waits until the server returns a result using another asynchronous RPC.Is this approach the same as letting the client execute a normal RPC?What if we replace the asynchronous RPCs with asynchronous RPCs?A:No,this is not the same.An asynchronous RPC returns an acknowledge-ment to the caller,meaning that after the ?rst call by the client,an additional message is sent across the network.Likewise,the server is acknowledged that its response has been delivered to the client.Two asynchronous RPCs may be the same,provided reliable communication is guaranteed.This is generally not the case.

8.Q:Instead of letting a server register itself with a daemon as is done in DCE,we could also choose to always assign it the same endpoint.That endpoint can then be used in references to objects in the server ’s address space.What is the main drawback of this scheme?A:The main drawback is that it becomes much harder to dynamically allo-cate objects to servers.In addition,many endpoints need to be ?xed,instead of just one (i.e.,the one for the daemon).For machines possibly having a

large number of servers,static assignment of endpoints is not a good idea.

9.Q:Give an example implementation of an object reference that allows a client to bind to a transient remote object.w w w .k h d a w .c o m 课后答案

PROBLEM SOLUTIONS FOR CHAPTER 27

A:Using Java,we can express such an implementation as the following class:

public class Object reference {

InetAddress server address;

//network address of object’s server int server endpoint;

//endpoint to which server is listening int object identi?er;

//identi?er for this object URL client code;

//(remote)?le containing client-side stub byte[]init data;

//possible additional initialization data }

The object reference should at least contain the transport-level address of

the server where the object resides.We also need an object identi ?er as the server may contain several objects.In our implementation,we use a URL to refer to a (remote)?le containing all the necessary client-side code.A generic array of bytes is used to contain further initialization data for that code.An alternative implementation would have been to directly put the client-code into the reference instead of a URL.This approach is followed,for example,in Java RMI where proxies are passed as reference.10.Q:Java and other languages support exceptions,which are raised when an error occurs.How would you implement exceptions in RPCs and RMIs?A:Because exceptions are initially raised at the server side,the server stub can do nothing else but catch the exception and marshal it as a special error response back to the client.The client stub,on the other hand,will have to unmarshal the message and raise the same exception if it wants to keep access to the server transparent.Consequently,exceptions now also need to be described in an interface de ?nition language.11.Q:Would it be useful to also make a distinction between static and dynamic RPCs?A:Yes,for the same reason it is useful with remote object invocations:it simply introduces more ?exibility.The drawback,however,is that much of the distribution transparency is lost for which RPCs were introduced in the ?rst place.12.Q:Some implementations of distributed-object middleware systems are entirely based on dynamic method invocations.Even static invocations are compiled to dynamic ones.What is the bene ?t of this approach?A:Realizing that an implementation of dynamic invocations can handle all invocations,static ones become just a special case.The advantage is that only

a single mechanism needs to be implemented.A possible disadvantage is that performance is not always as optimal as it could be had we analyzed the static invocation.w w w .k h d a w .c o m 课后答案

8PROBLEM SOLUTIONS FOR CHAPTER 2

13.Q:Describe how connectionless communication between a client and a server proceeds when using sockets.A:Both the client and the server create a socket,but only the server binds the socket to a local endpoint.The server can then subsequently do a blocking read call in which it waits for incoming data from any client.Likewise,after creating the socket,the client simply does a blocking call to write data to the server.There is no need to close a connection.

14.Q:Explain the difference between the primitives mpi bsend and mpi isend in MPI.A:The primitive mpi bsend uses buffered communication by which the caller passes an entire buffer containing the messages to be sent,to the local MPI runtime system.When the call completes,the messages have either been transferred,or copied to a local buffer.In contrast,with mpi isend ,the caller passes only a pointer to the message to the local MPI runtime system after which it immediately continues.The caller is responsible for not overwriting the message that is pointed to until it has been copied or transferred.15.Q:Suppose you could make use of only transient asynchronous communica-tion primitives,including only an asynchronous receive primitive.How would you implement primitives for transient synchronous communication?A:Consider a synchronous send primitive.A simple implementation is to send a message to the server using asynchronous communication,and subse-quently let the caller continuously poll for an incoming acknowledgement or response from the server.If we assume that the local operating system stores incoming messages into a local buffer,then an alternative implementation is to block the caller until it receives a signal from the operating system that a message has arrived,after which the caller does an asynchronous receive.16.Q:Now suppose you could make use of only transient synchronous commun-ication primitives.How would you implement primitives for transient asyn-chronous communication?A:This situation is actually simpler.An asynchronous send is implemented by having a caller append its message to a buffer that is shared with a process that handles the actual message transfer.Each time a client appends a mes-sage to the buffer,it wakes up the send process,which subsequently removes the message from the buffer and sends it its destination using a blocking call to the original send primitive.The receiver is implemented similarly by offer-ing a buffer that can be checked for incoming messages by an application.17.Q:Does it make sense to implement persistent asynchronous communication

by means of RPCs?

A:Yes,but only on a hop-to-hop basis in which a process managing a queue passes a message to a next queue manager by means of an RPC.Effectively,w w w .k h d a w .c o m 课后答案网

PROBLEM SOLUTIONS FOR CHAPTER 29

the service offered by a queue manager to another is the storage of a message.The calling queue manager is offered a proxy implementation of the interface to the remote queue,possibly receiving a status indicating the success or failure of each operation.In this way,even queue managers see only queues and no further communication.18.Q:In the text we stated that in order to automatically start a process to fetch

messages from an input queue,a daemon is often used that monitors the input queue.Give an alternative implementation that does not make use of a dae-mon.

A:A simple scheme is to let a process on the receiver side check for any incoming messages each time that process puts a message in its own queue.

19.Q:Routing tables in IBM MQSeries,and in many other message-queuing systems,are con ?gured manually.Describe a simple way to do this automati-cally.A:The simplest implementation is to have a centralized component in which the topology of the queuing network is maintained.That component simply calculates all best routes between pairs of queue managers using a known routing algorithm,and subsequently generates routing tables for each queue manager.These tables can be downloaded by each manager separately.This approach works in queuing networks where there are only relatively few,but possibly widely dispersed,queue managers.A more sophisticated approach is to decentralize the routing algorithm,by having each queue manager discover the network topology,and calculate its own best routes to other managers.Such solutions are widely applied in com-puter networks.There is no principle objection for applying them to message-queuing networks.20.Q:How would you incorporate persistent asynchronous communication into a model of communication based on RMIs to remote objects?A:An RMI should be asynchronous,that is,no immediate results are expected at invocation time.Moreover,an RMI should be stored at a special server that will forward it to the object as soon as the latter is up and running in an object server.21.Q:With persistent communication,a receiver generally has its own local buffer where messages can be stored when the receiver is not executing.To create such a buffer,we may need to specify its size.Give an argument why this is preferable,as well as one against speci ?cation of the size.

A:Having the user specify the size makes its implementation easier.The sys-tem creates a buffer of the speci ?ed size and is done.Buffer management becomes easy.However,if the buffer ?lls up,messages may be lost.The alternative is to have the communication system manage buffer size,starting w w w .k h d a w .c o m 课后答案

10PROBLEM SOLUTIONS FOR CHAPTER 2

with some default size,but then growing (or shrinking)buffers as need be.This method reduces the chance of having to discard messages for lack of room,but requires much more work of the system.

22.Q:Explain why transient synchronous communication has inherent scalabil-

ity problems,and how these could be solved.

A:The problem is the limited geographical scalability.Because synchronous communication requires that the caller is blocked until its message is received,it may take a long time before a caller can continue when the receiver is far away.The only way to solve this problem is to design the cal-ling application so that it has other useful work to do while communication takes place,effectively establishing a form of asynchronous communication.

23.Q:Give an example where multicasting is also useful for discrete data

streams.

A:Passing a large ?le to many users as is the case,for example,when updat-ing mirror sites for Web services or software distributions.

24.Q:How could you guarantee a maximum end-to-end delay when a collection

of computers is organized in a (logical or physical)ring?

A:We let a token circulate the ring.Each computer is permitted to send data across the ring (in the same direction as the token)only when holding the token.Moreover,no computer is allowed to hold the token for more than T seconds.Effectively,if we assume that communication between two adjacent computers is bounded,then the token will have a maximum circulation time,which corresponds to a maximum end-to-end delay for each packet sent.

25.Q:How could you guarantee a minimum end-to-end delay when a collection of computers is organized in a (logical or physical)ring?A:Strangely enough,this is much harder than guaranteeing a maximum delay.The problem is that the receiving computer should,in principle,not receive data before some elapsed time.The only solution is to buffer packets as long as necessary.Buffering can take place either at the sender,the receiver,or somewhere in between,for example,at intermediate stations.The best place to temporarily buffer data is at the receiver,because at that point there are no more unforeseen obstacles that may delay data delivery.The receiver need merely remove data from its buffer and pass it to the applica-tion using a simple timing mechanism.The drawback is that enough buffering capacity needs to be provided.

26.Q:Imagine we have a token bucket speci ?cation where the maximum data

unit size is 1000bytes,the token bucket rate is 10million bytes/sec,the token bucket size is 1million bytes,and the maximum transmission rate is 50mil-lion bytes/sec.How long can a burst of maximum speed last?w w w .k h d a w .c o m 课后答案

PROBLEM SOLUTIONS FOR CHAPTER 211

A:Call the length of the maximum burst interval ?t .In an extreme case,the bucket is full at the start of the interval (1million bytes)and another 10?t comes in during that interval.The output during the transmission burst con-sists of 50?t million bytes,which should be equal to (1+10?t ).Consequently,?t is equal to 25msec.

w w w .k

h

d

a w

.

c

o

m

课后

答案网

12

SOLUTIONS TO CHAPTER 3PROBLEMS

1.Q:In this problem you are to compare reading a ?le using a single-threaded ?le server and a multithreaded server.It takes 15msec to get a request for work,dispatch it,and do the rest of the necessary processing,assuming that the data needed are in a cache in main memory.If a disk operation is needed,as is the case one-third of the time,an additional 75msec is required,during which time the thread sleeps.How many requests/sec can the server handle if it is single threaded?If it is multithreaded?

A:In the single-threaded case,the cache hits take 15msec and cache misses take 90msec.The weighted average is 2/3×15+1/3×90.Thus the mean request takes 40msec and the server can do 25per second.For a mul-tithreaded server,all the waiting for the disk is overlapped,so every request takes 15msec,and the server can handle 662/3requests per second.

2.Q:Would it make sense to limit the number of threads in a server process?A:Yes,for two reasons.First,threads require memory for setting up their own private stack.Consequently,having many threads may consume too much memory for the server to work properly.Another,more serious reason,is that,to an operating system,independent threads tend to operate in a chaotic manner.In a virtual memory system it may be dif ?cult to build a rela-tively stable working set,resulting in many page faults and thus I/O.Having many threads may thus lead to a performance degradation resulting from page thrashing.

3.Q:In the text,we described a multithreaded ?le server,showing why it is better than a single-threaded server and a ?nite-state machine server.Are there any circumstances in which a single-threaded server might be better?Give an example.A:Yes.If the server is entirely CPU bound,there is no need to have multiple threads.It may just add unnecessary complexity.As an example,consider a telephone directory assistance number (like 555-1212)for an area with 1mil-lion people.If each (name,telephone number)record is,say,64characters,the entire database takes 64megabytes,and can easily be kept in the server ’s memory to provide fast lookup.

4.Q:Statically associating only a single thread with a lightweight process is not such a good idea.Why not?A:Such an association effectively reduces to having only kernel-level

threads,implying that much of the performance gain of having threads in the ?rst place,is lost.

5.Q:Having only a single lightweight process per process is also not such a good idea.Why not?w w w .k h d a w .c o m 课后答案

PROBLEM SOLUTIONS FOR CHAPTER 313

A:In this scheme,we effectively have only user-level threads,meaning that any blocking system call will block the entire process.

6.Q:Describe a simple scheme in which there are as many lightweight processes as there are runnable threads.A:Start with only a single LWP and let it select a runnable thread.When a runnable thread has been found,the LWP creates another LWP to look for a next thread to execute.If no runnable thread is found,the LWP destroys itself.

7.Q:Proxies can support replication transparency by invoking each replica,as explained in the text.Can (the server side of)an object be subject to a repli-cated invocation?A:Yes:consider a replicated object A invoking another (nonreplicated)object B .If A consists of k replicas,an invocation of B will be done by each replica.However,B should normally be invoked only once.Special measures are needed to handle such replicated invocations.8.Q:Constructing a concurrent server by spawning a process has some advan-tages and disadvantages compared to multithreaded servers.Mention a few.A:An important advantage is that separate processes are protected against each other,which may prove to be necessary as in the case of a superserver handling completely independent services.On the other hand,process spawn-ing is a relatively costly operation that can be saved when using mul-tithreaded servers.Also,if processes do need to communicate,then using threads is much cheaper as in many cases we can avoid having the kernel implement the communication.9.Q:Sketch the design of a multithreaded server that supports multiple proto-cols using sockets as its transport-level interface to the underlying operating system.A:A relatively simple design is to have a single thread T waiting for incom-ing transport messages (TPDUs).If we assume the header of each TPDU con-tains a number identifying the higher-level protocol,the tread can take the payload and pass it to the module for that protocol.Each such module has a separate thread waiting for this payload,which it treats as an incoming request.After handling the request,a response message is passed to T ,which,in turn,wraps it in a transport-level message and sends it to tthe proper desti-nation.10.Q:How can we prevent an application from circumventing a window

manager,and thus being able to completely mess up a screen?

A:Use a microkernel approach by which the windowing system including the window manager are run in such a way that all window operations are w w w .k

h d a w .c o m 课后答案网

14PROBLEM SOLUTIONS FOR CHAPTER 3

required to go through the kernel.In effect,this is the essence of transferring the client-server model to a single computer as we also explained in Chap.1.11.Q:Explain what an object adapter is.A:An object adapter is a generic program capable of accepting incoming invocation requests and passing these on to the server-side stub of an object.An adapter is primarily responsible for implementing an invocation policy,which determines if,how,and how many multiple threads are used to invoke an object.

12.Q:Mention some design issues for an object adapter that is to support per-sistent objects.A:The most important issue is perhaps generating an object reference that can be used independently of the current server and adapter.Such a reference should be able to be passed on to a new server and to perhaps indicate a speci ?c activation policy for the referred object.Other issues include exactly when and how a persistent object is written to disk,and to what extent the object ’s state in main memory may differ from the state kept on disk.13.Q:Change the procedure thread per object in the example of the object adapters,such that all objects under control of the adapter are handled by a single thread.A:The code stays almost the same,except that we need to create only a sin-gle thread that runs a modi ?ed version of thread per object .This thread is referred to as adapter thread (its creation is not shown).When the demulti-plexer calls the adapter,it puts a message in the buffer of adapter thread ,after which the latter picks it up as before.The adapter thread invokes the appropriate stub,and handles the response message.#include #include #de ?ne MAX OBJECTS 100#de ?ne NULL 0#de ?ne ANY ?1METHOD CALL invoke[MAX OBJECTS];/*array of pointers to stubs */THREAD *root;/*demultiplexer thread */THREAD *adapter thread /*thread that runs single thread*/void single thread(long object id){message *req,*res;/*request/response message*/unsigned size;/*size of messages */char **results;/*array with all results*/while(TRUE){w w w .k

h d a w .c o m 课后答案网

PROBLEM SOLUTIONS FOR CHAPTER 3

15

get msg(&size,(char*)&req);/*block for invocation request */

/*Pass request to the appropriate stub.The stub is assumed to */

/*allocate memory for storing the results.*/(invoke[req->object id]*)(req->size,req->data,&size,results);

res =malloc(sizeof(message)+size);/*create response message */res->object id =object id;/*identify object */res->method id =req.method id;/*identify method */res->size =size;/*set size of invocation results */memcpy(res->data,results,size);/*copy results into response */put msg(root,sizeof(res),res);/*append response to buffer */free(req);/*free memory of request */free(*results);/*free memory of results*/}

}

void invoke adapter(long oid,message *request){put msg(adapter thread,sizeof(request),request);}14.Q:Is a server that maintains a TCP/IP connection to a client stateful or state-less?A:Assuming the server maintains no other information on that client,one could justi ?ably argue that the server is stateless.The issue is that not the server,but the transport layer at the server maintains state on the client.What the local operating systems keep track of is,in principle,of no concern to the server.15.Q:Imagine a Web server that maintains a table in which client IP addresses are mapped to the most recently accessed Web pages.When a client connects to the server,the server looks up the client in its table,and if found,returns the registered page.Is this server stateful or stateless?A:It can be strongly argued that this is a stateless server.The important issue with stateless designs is not if any information is maintained by the server on its clients,but rather how accurate that information has to be.In this exam-ple,if the table is lost for what ever reason,the client and server can still properly interact as if nothing happened.In a stateful design,such an interac-tion would be possible only after the server had recovered from a possible

fault.

16.Q:To what extent does Java RMI rely on code migration?

A:Considering that object references are actually portable proxies,each time an object reference is passed,we are actually migrating code across the w w w .k h d a w .c o m 课后答案网

16PROBLEM SOLUTIONS FOR CHAPTER 3

network.Fortunately,proxies have no execution state,so that support for sim-ple weak mobility is all that is needed.17.

Q:Strong mobility in UNIX systems could be supported by allowing a pro-cess to fork a child on a remote machine.Explain how this would work.A:Forking in UNIX means that a complete image of the parent is copied to the child,meaning that the child continues just after the call to fork .A similar approach could be used for remote cloning,provided the target platform is exactly the same as where the parent is executing.The ?rst step is to have the target operating system reserve resources and create the appropriate process and memory map for the new child process.After this is done,the parent ’s image (in memory)can be copied,and the child can be activated.(It should be clear that we are ignoring several important details here.)18.Q:In Fig.3-13it is suggested that strong mobility cannot be combined with executing migrated code in a target process.Give a counterexample.A:If strong mobility takes place through thread migration,it should be possi-ble to have a migrated thread be executed in the context of the target process.19.Q:Consider a process P that requires access to ?le F which is locally avail-able on the machine where P is currently running.When P moves to another machine,it still requires access to F .If the ?le-to-machine binding is ?xed,how could the systemwide reference to F be implemented?A:A simple solution is to create a separate process Q that handles remote requests for F .Process P is offered the same interface to F as before,for example in the form of a proxy.Effectively,process Q operates as a ?le server.20.

Q:Each agent in D ’Agents is implemented by a separate process.Agents can communicate primarily through shared ?les and by means of message pass-ing.Files cannot be transferred across machine boundaries.In terms of the mobility framework given in Sec.3.4,which parts of an agent ’s state,as given in Fig.3-19,comprise the resource segment?A:The resource segment contains all references to local and global resources.As such,it consists of those variables that refer to other agents,local ?les,and so on.In D ’Agents,these variables are primarily contained in the part consisting of global program variables.What makes matters simple,is that virtually all resources in D ’Agents are nontransferrable.Only agents can move betweeen machines.Because agents are already named by global refer-ences,namely an (address,local-id)pair,transforming references to resources in the presence of migration is relatively simple in D ’Agents.21.Q:Compare the architecture of D ’Agents with that of an agent platform in

the FIPA model.

A:The main distinction between the two is that D ’Agents does not really have a separate directory service.Instead,it offers only a low-level naming w w w .k h d a w .c o m 课后答案网

PROBLEM SOLUTIONS FOR CHAPTER 317

service by which agents can be globally referenced.The management com-ponent in the FIPA architecture corresponds to the server in D ’Agents,whereas the ACC is implemented by the communication layer.The FIPA model provides no further details on the architecture of an agent,in contrast to D ’Agents.

22.Q:Where do agent communication languages (ACLs)?t into the OSI model?

A:Such languages are part of the application layer.

23.Q:Where does an agent communication language ?t into the OSI model,when it is implemented on top of a system for handling e-mail,such as in D ’Agents?What is the bene ?t of such an approach?A:It would still be part of the application layer.An important reason for implementing ACLs on top of e-mail,is simplicity.A complete,worldwide communicaton infrastructure is available for handling asynchronous message-passing between agents.Essentially,such an approach comes close to message-queuing systems discussed in Chap.2.24.Q:Why is it often necessary to specify the ontology in an ACL message?A:In this context,an ontology can best be interpreted as a reference to a stan-dard interpretation of the actual data contained in an ACL https://www.360docs.net/doc/ae17489562.html,ually,data in message-passing systems is assumed to be correctly interpreted by the sender and receiver of a message.Agents are often considered to be highly independent from each other.Therefore,it can not always be assumed that the receiving side will interpret the transferred data correctly.Of course,it is necessary that there is common agreement on the interpretation of the ontol-ogy ?eld.w w w .k h d a w .c o m 课后答案网

18

SOLUTIONS TO CHAPTER 4PROBLEMS

1.Q:Give an example of where an address of an entity E needs to be further resolved into another address to actually access E .

A:IP addresses in the Internet are used to address hosts.However,to access a host,its IP address needs to be resolved to,for example,an Ethernet address.

2.Q:Would you consider a URL such as https://www.360docs.net/doc/ae17489562.html,/index.html to be location independent?What about http://www.acme.nl/index.html ?

A:Both names can be location independent,although the ?rst one gives fewer hints on the location of the named entity.Location independent means that the name of the entity is independent of its address.By just considering a name,nothing can be said about the address of the associated entity.

3.Q:Give some examples of true identi ?ers.

A:Examples are ISBN numbers for books,identi ?cation numbers for software and hardware products,employee numbers within a single organiza-tion,and Ethernet addresses (although some addresses are used to identify a machine instead of just the Ethernet board).

4.Q:How is a mounting point looked up in most UNIX systems?A:By means of a mount table that contains an entry pointing to the mount point.This means that when a mounting point is to be looked up,we need to go through the mount table to see which entry matches a given mount point.

5.Q:Jade is a distributed ?le system that uses per-user name spaces (see In other words,each user has his own,private name space.Can names from such name spaces be used to share resources between two different users?A:Yes,provided names in the per-user name spaces can be resolved to names in a shared,global name space.For example,two identical names in different name spaces are,in principle,completely independent and may refer to different entities.To share entities,it is necessary to refer to them by names from a shared name space.For example,Jade relies on DNS names and IP addresses that can be used to refer to shared entities such as FTP sites.

6.Q:Consider DNS.To refer to a node N in a subdomain implemented as a dif-ferent zone than the current domain,a name server for that zone needs to be speci ?ed.Is it always necessary to include a resource record for that server ’s address,or is it sometimes suf ?cient to provide only its domain name?A:When the name server is represented by a node NS in a domain other than

the one in which N is contained,it is enough to give only its domain name.In that case,the name can be looked up by a separate DNS query.This is not possible when NS lies in the same subdomain as N ,for in that case,you would need to contact the name server to ?nd out its address.w w w .k h d a w .c o m 课后答案网

分布式系统概念与设计(第三版)课后习题与答案Chapter5

Chapter 5Exercise Solutions 5.1The Election interface provides two remote methods: vote: with two parameters through which the client supplies the name of a candidate (a string) and the ‘voter’s number’ (an integer used to ensure each user votes once only). The voter’s numbers are allocated sparsely from the range of integers to make them hard to guess. result: with two parameters through which the server supplies the client with the name of a candidate and the number of votes for that candidate. Which of the parameters of these two procedures are input and which are output parameters? 5.1 Ans. vote: input parameters: name of candidate, voter’s number; result: output parameters: name of candidate, number of votes 5.2Discuss the invocation semantics that can be achieved when the request-reply protocol is implemented over a TCP/IP connection, which guarantees that data is delivered in the order sent, without loss or duplication. Take into account all of the conditions causing a connection to be broken. 5.2 Ans. A process is informed that a connection is broken: ?when one of the processes exits or closes the connection. ?when the network is congested or fails altogether Therefore a client process cannot distinguish between network failure and failure of the server. Provided that the connection continues to exist, no messages are lost, therefore, every request will receive a corresponding reply, in which case the client knows that the method was executed exactly once. However, if the server process crashes, the client will be informed that the connection is broken and the client will know that the method was executed either once (if the server crashed after executing it) or not at all (if the server crashed before executing it). But, if the network fails the client will also be informed that the connection is broken. This may have happened either during the transmission of the request message or during the transmission of the reply message. As before the method was executed either once or not at all. Therefore we have at-most-once call semantics. 5.3Define the interface to the Election service in CORBA IDL and Java RMI. Note that CORBA IDL provides the type long for 32 bit integers. Compare the methods in the two languages for specifying input and output arguments. 5.3 Ans. CORBA IDL:

通信系统原理复习题

《通信系统原理》试题 一、单项选择题 1.在抗加性高斯白噪声性能方面,2ASK、2FSK、2PSK从差到优的次序。 (A) 2FSK、2ASK、2PSK (B)2ASK、2FSK、2PSK (C) 2ASK、2PSK、2FSK (D)2PSK、2FSK、2ASK 2.AM信号一般采用解调,SSB和DSB信号一般采用解调。 (A)包络,同步(B)鉴频器,同步 (C)相干,差分相干(D)同步,包络 3.根据香农公式,假设信道容量为C,信道信息传输速率为R,则在时,理 论上可实现无差错传输。 (A)R=C (B)R>C (C)R≤C (D)R≠C 编码后过最多出现( )个连续0。 4.二进制序列经过HDB 3 (A)2 (B)3 (C)4 (D) 5 5.为实现数字信号的最佳接收,采用最小均方误差准则设计的最佳接收机是()。 (A)相关接收机;(C)理想接收机 (B)匹配滤波器;(D)以上都不是 为:()。 6.若要纠正2个错码,则分组码的最小码距 d min (A)3 (B)4 (C)5 (D)6 7.2PSK信号的带宽是基带信号带宽的()倍。 (A)0.5 (B)1 (C)2 (D)3 8.电话信道的带宽是3400Hz,若要求传输6800bit/s,则要求信道的最小信噪比是

()。 (A)1 (B)3 (C)4 (D)7 9.一个二进制数字通信系统,其码元速率为104Baud,连续发送1个小时后,收到的 为()。 错吗为36个,则误码率P e (A)10-6(B)3.6*10-6(C)36*10-6(D)104 10.某信息源发送4个二进制脉冲编码信号A、B、C、D,信号独立出现,其出现概率 分别为1/4,1/8,1/8,1/2,则该信息源信号的平均信息量为()bit/symbol。 (A)0.75 (B)1.75 (C)2.75 (D)3.75 11.在(7,3)线形分组码的一个码组中,信息码元的位数是()。 (A)10 (B)3 (C)4 (D)7 已知某二进制数字基带系统的传输特性如图c1所示,请回答12-16小题。 12.奈氏带宽BN是()。 (A)0 (B)2 (C)2.5 (D)3 13.码元传输速率为()。 (A)0 (B)4 (C)5 (D)6 14.系统带宽为()。 (A)0 (B)2 (C)2.5 (D)3 15.滚降系数为()。

管理信息系统课后答案

《管理信息系统》习题练习(一) 习题1(管理信息系统的定义、概念和结构) 1、管理信息系统是什么?它和一般的计算机应用有什么不同? 答:管理信息系统是一个以人为主导,利用计算机硬件、软件、网络通信设备以及其他办公设备,进行信息的收集、传输、加工、储存、更新和维护,以企业战略竞优、提高效益和效率为目的,支持企业高层决策、中层控制、基层动作的集成化的人机系统。 管理信息系统与计算机应用的不同是:计算机只是管理信息系统的一种工具。没有计算机也有管理信息系统,管理信息系统只有优劣之分,不存在有无的问题。 4、管理信息系统的结构有几个视图?你是否觉得还有另外的视图?是什么?答:总体结构、开环结构、闭环结构、金字塔结构、功能结构、功能-过程结构、软件结构、主机终端网结构、微机网(星形、母线、环形)结构等。 还应该有人-机关系结构。 5、管理信息系统的开发特点是什么?有几种开发方式?各有哪些长处和缺点? 答:(1)必须满足合理确定系统目标、组织系统性队伍和遵循系统工程开发步骤三大系统工程成功要素;(2)耗资巨大、历时相当长;(3)系统分析工作量比重很大;(4)不能较早买机器设备;(5)程序编写要在很晚才进行。 一是按信息系统开发步骤进行:建立领导小组、组成系统、进行系统规划、系统分析、系统设计、系统实现、系统评价、返回系统分析;二是基于企业过程再工程BPR的管理系统变革步骤进行:基于BPR的管理系统变革准备、管理系统与信

息系统规划、住处系统开发和组织设计调整、新系统运行、系统评价、返回准备。前者是从新开始,可以以高起点做到领先,但耗资耗时;后者阻力大、难于达到最优,但见效快、节约时间与成本。 6、生命周期开发方式每分阶段的重点是什么?评述生命周期法开发的问题和困难。 答:(1)系统分析阶段:呈交服务请求、评价服务请求、组织可行性研究队伍、识别约束、提供现有系统文件、调查技术转换、完成建议系统的初步设计、定义项目围、准备收益/成本分析、作出对可行性研究的决策、选定开发队伍、估计和作出人员委托、训练人员、建立详细进度计划、和用户人员交谈、确定数据库要求、建立控制和回转手续;(2)系统设计阶段:完成详细设计、进行用户和信息服务预排、选择硬件、准备草图、描述数据实体说明、准备程序说明、指定主要程序员、排优先和分配程序、调度程序准备、写、调试和文件化程序;(3)切换和实现阶段:完成切换计划、进行系统接收测试、开发用户手册、交用户培训计划、创造和转换文件/数据库、完成并且运行;(4)实现后的评价阶段:更新费用、进行实现后的评价、准备系统评价计划。 问题是耗资耗时,不能早买机器,软件要很晚编写;困难是领导对花钱买设备感到看得见摸得着,而对投资搞规划搞软件却舍不得。 习题2(管理知识基础、信息、系统) 4、什么是数据?什么是信息?试举几个实用例子加以描述。 答:数据是一组表示数量、行动和目标的非随机的可鉴别的符号,数据项可以按使用的目的组织成数据结构;信息是经过加工后的数据,它对接收者的行为能产

计算机操作系统原理复习题

课程成绩构成 笔试:70% 平时:30% 试卷构成: 名词解释五小题,共15分; 简答五小题,共35分; 综合题四小题,共50分。 第一章操作系统引论 1、设计现代操作系统的主要目标? 答:(1)有效性(2)方便性(3)可扩充性(4)开放性 2、操作系统的作用? 答:(1)作为用户与计算机硬件系统之间的接口 (2)作为计算机系统资源的管理者 (3)实现了对计算机资源的抽象 3、操作系统发展的主要动力? 答:(1)不断提高计算机资源的利用率 (2)方便用户 (3)器件的不断更新换代 (4)计算机体系结构的不断发展 4、为什么说操作系统实现了对计算机资源的抽象? 答:OS首先在裸机上覆盖一层I/O设备管理软件,实现了对计算机硬件操作的第一层次抽象;在第一层软件上再覆盖文件管理软件,实现了对硬件资源操作的第二层次抽象。OS 通过在计算机硬件上安装多层系统软件,增强了系统功能,隐藏了对硬件操作的细节,由它们共同实现了对计算机资源的抽象。 5、单道批理?多道程序设计?多道批处理? 单道批处理系统定义:把一批作业以脱机方式输入到磁带上,并在系统中配上监督程序(Monitor),在它的控制下使这批作业能一个接一个地连续处理,直至磁带(盘)上的所有作业全部完成,系统对作业的处理都是成批地进行的,且在内存中始终只保持一道作业。 多道批处理系统定义:由多道程序设计技术组成的系统。

6、分时系统产生主要动力?关键技术?特征? 答:(1)推动分时系统形成和发展的主要动力是更好地满足用户的需要。主要表现在:CPU 的分时使用缩短了作业的平均周转时间;人机交互能力使用户能直接控制自己的作业;主机的共享使多用户能同时使用同一台计算机,独立地处理自己的作业。 (2)关键技术:为实现分时系统,其中,最关键的问题是如何使用户能与自己的作业进行交互,即当用户在自己的终端上键入命令时,系统应能及时接收并及时处理该命令,再将结果返回给用户。此后,用户可继续键入下一条命令,此即人—机交互。应强调指出,即使有多个用户同时通过自己的键盘键入命令, (3)特征:多路性;独立性;及时性;交互性。 7、实时任务划分?实时系统与分时系统比较? 实时任务划分:(1)按任务执行时是否呈现周期性来划分 (2)根据对截止时间的要求来划分。 比较:(1)多路性。实时信息处理系统的多路性主要表现在系统周期性的对多路现场信息进行采集,以及对多个对象或多个执行机构进行控制。而分时系统的多路性则与用户情况有关,时多时少。 (2)独立性。实时信息处理系统的每个终端用户在向实时系统提出服务请求时是彼此独立操作,互不干扰。而分时控制系统中,对象的采集和对象的控制也是互不干扰。 (3)及时性。实时信息处理系统的及时性以人所能接受的等待时间来确定。分时系统的及时性是以控制对象所要求的开始截止时间或完成时间来确定的,一般为毫秒级。 (4)交互性。实时信息处理系统仅限于访问系统中某些特定的专用服务程序。分时系统能够向终端用户提供数据处理和资源共享等服务。 (5)可靠性。分时系统也要求可靠性,但实时系统要求更高度的可靠性。 8、操作系统定义?特征? 答:操作系统的定义:操作系统(operating system,简称OS)是计算机系统中的一个系统软件,它是这样一些程序模块的集合——它们管理和控制计算机系统中的软件和硬件资源,合理地组织计算机工作流程,以便有效地利用这些资源为用户提供一个功能强大、使用方便和可扩展的工作环境,从而在计算机与其用户之间起到接口的作用。 特征:(1)并发性(2)共享性(3)虚拟技术(4)异步性 9、是什么原因使操作系统具有异步性特征? 答:操作系统的异步性体现在三个方面:一是进程的异步性,进程以人们不可预知的速度向前推进,二是程序的不可再现性,即程序执行的结果有时是不确定的,三是程序执行时间的不可预知性,即每个程序

分布式大数据库系统复习题

一、何为分布式数据库系统?一个分布式数据库系统有哪些特点? 答案:分布式数据库系统通俗地说,是物理上分散而逻辑上集中的数据库系统。分布式数据库系统使用计算机网络将地理位置分散而管理和控制又需要不同程度集中的多个逻辑单位连接起来,共同组成一个统一的数据库系统。因此,分布式数据库系统可以看成是计算机网络与数据库系统的有机结合。一个分布式数据库系统具有如下特点: 物理分布性,即分布式数据库系统中的数据不是存储在一个站点上,而是分散存储在由计算机网络连接起来的多个站点上,而且这种分散存储对用户来说是感觉不到的。 逻辑整体性,分布式数据库系统中的数据物理上是分散在各个站点中,但这些分散的数据逻辑上却构成一个整体,它们被分布式数据库系统的所有用户共享,并由一个分布式数据库管理系统统一管理,它使得“分布”对用户来说是透明的。 站点自治性,也称为场地自治性,各站点上的数据由本地的DBMS管理,具有自治处理能力,完成本站点的应用,这是分布式数据库系统与多处理机系统的区别。 另外,由以上三个分布式数据库系统的基本特点还可以导出它的其它特点,即:数据分布透明性、集中与自治相结合的控制机制、存在适当的数据冗余度、事务管理的分布性。 二、简述分布式数据库的模式结构和各层模式的概念。 分布式数据库是多层的,国分为四层: 全局外层:全局外模式,是全局应用的用户视图,所以也称全局试图。它为全局概念模式的子集,表示全局应用所涉及的数据库部分。 全局概念层:全局概念模式、分片模式和分配模式 全局概念模式描述分布式数据库中全局数据的逻辑结构和数据特性,与集中式数据库中的概念模式是集中式数据库的概念视图一样,全局概念模式是分布式数据库的全局概念视图。分片模式用于说明如何放置数据库的分片部分。分布式数据库可划分为许多逻辑片,定义片段、片段与概念模式之间的映射关系。分配模式是根据选定的数据分布策略,定义各片段的物理存放站点。 局部概念层:局部概念模式是全局概念模式的子集。局部层:局部模式 局部模式是分布式数据库中关于物理数据库的描述,类同集中式数据库中的模式,但其描述的容不仅包含只局部于本站点的数据的存储描述,还包括全局数据在本站点的存储描述。 三、简述分布式数据库系统中的分布透明性,举例说明分布式数据库简单查询的 各级分布透明性问题。 分布式数据库中的分布透明性即分布独立性,指用户或用户程序使用分布式数据库如同使用集中式数据库那样,不必关心全局数据的分布情况,包括全局数据的逻辑分片情况、逻辑片段的站点位置分配情况,以及各站点上数据库的数据模型等。即全局数据的逻辑分片、片段的物理位置分配,各站点数据库的数据模型等情况对用户和用户程序透明。

(完整版)管理信息系统-课后习题答案

1、什么是信息?信息、数据有何区别? 答:(1)信息是经过加工并对客观世界产生影响的数据。 区别:数据是客观的,它来源于客观的现实世界,它只反映某一客观存在的事实,而不能说明这一事实与我们的行动是否有关系;信息是对数据加工后的结果,它取决于人们的主观需求,要对人们的决策行动产生影响。 2、试述信息流与物流、资金流、事物流的关系。 信息流伴随物流、资金流、事物流的流动而流动,它既是其他各种流的表现和描述,又是用于掌握、指挥和控制其他流运动的软资源。是各种流控制的依据和基础。 5、为什么说管理信息系统并不能解决管理中的所有问题? 答:管理是一种复杂的获得,它既涉及客观环境,又涉及人的主观因素。由于生产和社会环境的复杂性,也由于事物之间复杂的相互联系和事物的多变性,等等原因,人们在解决管理问题时不可能掌握所有的数据,更不可能把所有的,待选择的解决方案都考虑进去,而管理信息系统解决问题时运行的程序是由人来编写的。管理信息系统是一个人机结合的系统,人不能解决的问题,依靠计算机也无法解决,因此仅靠管理信息系统是无法解决管理中的所有问题的。管理不仅是一门科学更是一门艺术,人们在实施管理的时候,不仅要运用这种科学的方法,还要运用一套技术和处理方式,这些都是管理信息系统所不能及的。 7、试述信息系统对人类生活与工作方式的有利和不利的影响。 答:有利:1、人与人之间的信息交流不再受时间与地域的限制,电子化书信的往来将人们更紧密地联系在一起。2、对文娱与新闻的获取将由被动接受变为主动选取,个性化风格得以增强。3、电子货币与自动购销系统大大方便了人们的消费,改变了人们的生活与消费习惯。4、信息系统的应用使团体工作不必面对面地坐在一起。人们可以在家里办公,并随时保持与同事之间的联系。 不利:1、在全球范围内,随着文化交流的扩大、交流内容的增加与交流方式的便捷,会使某些民族文化受到冲击。2、人们由直接交流变为间接交流,将在某种程度上淡薄感情色彩等等。 8、信息的主要特点(性质)有哪些,试举例说明。 事实性时效性不完全性等级性变换性价值性 供应商、订单 16.1试述订单驱动原理及其在制定供应链计划的重要性 原理供应链企业内部和企业间的一切活动都是围绕订单进行的 重要性:使供应链能够准时响应用户需求,加快物流速度并降低成本 16.2供应链企业在管理上采用纵横一体化的企业集成思想,指的是什么? 指纵向采用MRP II 等产生控制方法;横向采用订单驱动方法,确定完成日期和工作量指标,并进行跟踪监控。 16.3供应商管理库存的优点是什么?如何实现?它的难点是什么? 优点:减少供应链层次,减少管理费用,提升销售额;更好了解需求,资源利用率更高,市场分析结果更准确;库存成本降低,缺货情况减少(经销商) 难点:产品采购数量与采购价格问题 利益分配问题 实际工作的不断调整问题

学生分布式系统复习题与参考答案2

一、填空题 1.访问透明性是指对不同数据表示形式以及资源访问方式的隐藏。而位置透明是用户无法判别资源在系统中的物理位置。 2. 迁移透明性是指分布式系统中的资源移动不会影响该资源的访问方式。而复制透明是指对同一个资源存在多个副本的隐藏。 3. 一个开放的分布式系统就是根据一系列准则来提供服务,这些准则描述了所提供服务的语法和语义。 4. 集群计算系统一个突出的特征是它的同构性;它提供了最大限度的分布式透明性。可用于单个程序在多台计算机上并行地运行。 5. 网格计算系统具有高度的异构性:其硬件、操作系统、网络、管理域和安全策略等都不尽相同。 6. 网格计算系统一个关键问题是如何把来自不同计算机组织的资源集中起来,使一组人或机构进行协调工作。 7. 分布式事务处理的四个特性是:原子性、一致性、独立性和持久性。 8. 分布式普适系统应用程序的需求归纳为三种,它们是:接受上下文的变化、促使自主合成、认可共享为默认行为。 9. 分布式系统体系结构样式很多,其最重要的有:分层体系结构;基于对象的体系结构、以数据为中心的体系结构以及基于事件的体系结构等四类。10. 客户/服务器结构的应用程序通常划分为三层,它们是:用户接口层、处理层和数据层。 11. 在结构化点对点体系结构中覆盖网络是用一个确定性的过程来构成的,这个使用最多的进程是通过一个分布式哈希表来组织进程的。 12. 超级对等体通常是维护一个索引或充当一个代理程序的结点。 13. 分布式软件体系结构主要分集中式、非集中式和各种混合形式三大类。其非集中式体系结构又分为 结构化的点对点、非结构化的点对点、超级对等体 三种。 14. 实现软件自适应的基本技术分为要点分离、计算 映像和基于组件的设计三种类型。 15. 分布式的自主系统指的是自我管理、自我恢复、 自我配置和自我优化等各种自适应性。 16. 一个线程独立地执行它自己的程序代码。线程系 统一般只维护用来让多个线程共享CPU所必需的最 少量信息。 17. 有两种实现线程线程包的基本方法:一是可以构 造一个完全在用户模式下执行的线程;二是由内核 来掌管线程并进行调度。 18. 分布式系统中的多线程通常有:多线程用户和多 线程服务器两大类型。而以分发器/工作者模型组织 起来的多线程服务器是最为流行的一种。 19. 虚拟化可采用两种方法,一是构建一个运行时系 统,提供一套抽象指令集来执行程序。二是提供虚 拟机监视器。 20. 在服务器的组织结构中,迭代服务器是自己处理 请求,将响应返回给客户;而并发服务器将请求传 递给某个独立线程或其他进程来处理。 21. 服务器集群在逻辑上由三层组成,第一层是逻辑 交换机;第二层是应用/计算服务;第三层是文件/ 数据库系统。 22. 在代码迁移的框架结构中,进程包含三个段,它 们是代码段、资源段和执行段三个段。 23. 进程对资源的绑定有三种类型:一是按标识符绑 定;二是按值绑定;三是按类型绑定。而三种类型 的资源对机器的绑定是未连接资源、附着连接资源 和紧固连接资源。 24. 中间件是一种应用程序,它在逻辑上位于应用层 中,但在其中包含有多种通用协议,这些协议代表 各自所在的层,独立于其他更加特别的应用。 25. 在RPC操作中,客户存根的功能是将得到的参 数打包成消息,然后将消息发送给服务器存根。 26. 所有DCE的底层编程模型都是客户-服务器模 型。而DCE本身的一部分是由分布式文件服务、目 录服务、安全服务以及分布式时间服务等构成的。 27. IDL编译器的输出包括三个文件,它们是头文件、 客户存根和服务器存根。 28. 在面向消息的通信中,通常分为面向消息的瞬时 通信和持久通信两种机制。 29. 在面向消息的瞬时通信中,通常采用套接字接口 和消息传递接口。 30. 在面向持久的通信中,消息队列系统为持久异步 通信提供多种支持。它提供消息的中介存储能力。 31. 在消息队列系统中,队列由队列管理器来管理, 它与发送或接收消息的应用程序直接交互。 32. 在消息队列系统中,转换是由队列网络中特定结 点完成的,这些结点称为消息转换器。 33. 在面向流的通信中,数据流的传输模式有异步传 输模式、同步传输模式和等时传输模式等三种。 34. 在流与服务质量(QOS)描述中,服务质量特性指 的是数据传输所要求的比特率、创建会话的最大延 时、端到端的最大延时、最大延时抖动以及最大往 返延时等。 35. 流同步有两种类型,一种是在离散数据流与连续 数据流之间保持同步;另一种是连续数据流之间的 同步。 36. 在流同步的机制中,需要研究的两个问题是:一 个是两个流同步的基本机制;二是在网络环境下这 些机制的分布式版本。 37. 应用层多播的基本思想是结点组织成一个覆盖 网络,然后用它来传播信息给其成员。一个重要的 因素是网络路由器不在组成员中。

管理信息系统课后习题答案

第一章管理信息系统概论 1、请阐述信息管理和管理信息系统的区别和联系 2、结合一个实例,说明管理信息系统是人机一体化的系统。 3、从管理层次分类看,不同层次的管理信息系统在目的和功能上有何不同? 4、什么是?结合实例说明它有哪些应用。 5、什么是电子商务?它和管理信息系统有何联系? 6、管理信息系统发展历经了哪些阶段?各个阶段的典型应用技术是什么? 7、决策支持系统的基本特征是什么? 四、简答题 1、答:区别:信息管理的对象是信息以及与之相关的信息活动,信息活动包括信息的收集、存储、加工、传递和运用等,信息管理是管理的一种;而管理信息则是指经过加工处理后对企业生产经营活动产生影响的数据,是信息的一种。联系:管理信息是信息的一种,因此管理信息时信息管理的对象,是信息管理重要的资源,是科学决策的基础以及实施信息管理控制的依据。 2、略

、答:管理信息系统按照管理任务的层次由高到低进行划分可3.分为战略管理层、战术管理层和作业管理层。战略层的目的是支持企业的战略性的决策,系统的功能表现为全局性、方向性,或关系到企业竞争能力的重要问题的分析与决策。战术层和作业层管理的主要目的则是提高工作效用和工作效率,管理信息系统为战术层提供资源配置、运作绩效等经营状态的分析评估和计划落实的控制优化等功能,为作业层提供准确便捷的数据收集处理功能。 4、答: ( )客户关系管理,客户关系管理包括企业识别、挑选、获取、发展和保持客户的整个商业过程。其核心是客户价值管理,它将客户价值分为既成价值、潜在价值和模型价值,通过一对一营销原则,满足不同价值客户的个性化需求,提高客户忠诚度和保有率,实现客户价值持续贡献,从而全面提升企业盈利能力。目前在银行、通信、商贸等大型服务企业中得到较为理想的应用。 5、答:电子商务就是企业利用现代信息技术,特别是互连网技术来改变商务活动中的信息流程,从而改变业务流程,提高企业竞争力的一切商务活动。它包括了企业内部的协调与沟通、企业之间的合作及网上交易等三方面的内容。电子商务也是一类管理信息系统,但管理信息系统不一定需要应用互联网技术,而电子

分布式系统复习题及参考答案

关于分布式系统复习题与参考答案 一、填空题(每题n分,答错个扣分,全错全扣g,共计m分) 1.访问透明性是指对不同数据表示形式以及资源访问方式的隐藏。而位置透明是用户无法判别资源在系统中的物理位置。 2. 迁移透明性是指分布式系统中的资源移动不会影响该资源的访问方式。而复制透明是指对同一个资源存在多个副本的隐藏。 3. 一个开放的分布式系统就是根据一系列准则来提供服务,这些准则描述了所提供服务的语法和语义。 4. 集群计算系统一个突出的特征是它的同构性;它提供了最大限度的分布式透明性。可用于单个程序在多台计算机上并行地运行。 5. 网格计算系统具有高度的异构性:其硬件、操作系统、网络、管理域和安全策略等都不尽相同。 6. 网格计算系统一个关键问题是如何把来自不同计算机组织的资源集中起来,使一组人或机构进行协调工作。 7. 分布式事务处理的四个特性是:原子性、一致性、独立性和持久性。 8. 分布式普适系统应用程序的需求归纳为三种,它们是:接受上下文的变化、促使自主合成、认可共享为默认行为。 9. 分布式系统体系结构样式很多,其最重要的有:分层体系结构;基于对象的体系结构、以数据为中心的体系结构以及基于事件的体系结构等四类。 10. 客户/服务器结构的应用程序通常划分为三层,它们是:用户接口层、处理层和数据层。 11. 在结构化点对点体系结构中覆盖网络是用一个确定性的过程来构成的,这个使用最多的进程是通过一个分布式哈希表来组织进程的。 12. 超级对等体通常是维护一个索引或充当一个代理程序的结点。 13. 分布式软件体系结构主要分集中式、非集中式和各种混合形式三大类。其非集中式体系结构又分为结构化的点对点、非结构化的点对点、超级对等体三种。 14. 实现软件自适应的基本技术分为要点分离、计算映像和基于组件的设计三种类型。 15. 分布式的自主系统指的是自我管理、自我恢复、自我配置和自我优化等各种自适应性。 16. 一个线程独立地执行它自己的程序代码。线程系统一般只维护用来让多个线程共享CPU 所必需的最少量信息。 17. 有两种实现线程线程包的基本方法:一是可以构造一个完全在用户模式下执行的线程;二是由内核来掌管线程并进行调度。 18. 分布式系统中的多线程通常有:多线程用户和多线程服务器两大类型。而以分发器/工作者模型组织起来的多线程服务器是最为流行的一种。 19. 虚拟化可采用两种方法,一是构建一个运行时系统,提供一套抽象指令集来执行程序。二是提供虚拟机监视器。 20. 在服务器的组织结构中,迭代服务器是自己处理请求,将响应返回给客户;而并发服务器将请求传递给某个独立线程或其他进程来处理。 21. 服务器集群在逻辑上由三层组成,第一层是逻辑交换机;第二层是应用/计算服务;第三层是文件/数据库系统。 22. 在代码迁移的框架结构中,进程包含三个段,它们是代码段、资源段和执行段三个段。 23. 进程对资源的绑定有三种类型:一是按标识符绑定;二是按值绑定;三是按类型绑定。而三种类型的资源对机器的绑定是未连接资源、附着连接资源和紧固连接资源。 24. 中间件是一种应用程序,它在逻辑上

管理信息系统课后习题及参考答案

第1章 1.什么就是信息,什么就是数据?简述二者之间的联系与区别。 2.什么就是信息循环? 3.简述信息的层次与信息的类型及主要特性。 4.简述管理信息的特点。 6.简述信息系统的定义。 7.什么就是管理信息系统,它有什么特点? 第2章 1.建设管理信息系统方法应包含的内容主要有哪些? 2.简述管理信息系统的生命周期。 3.结构化方法的基本思想就是什么? 4.什么就是结构化生命周期法? 5.什么就是快速原型法? 6.简述在系统分析阶段使用原型法的开发过程。 7.试述本教材为什么选择结构化生命周期法作为重点讲述内容。 8.管理信息系统的开发方式有哪些? 第3章 1.试述系统规划的主要目标与任务。 2.试述系统规划工作的主要特点与关键问题。 3.什么就是管理信息系统开发中的系统分析?其主要目标与活动内容有哪些?系统分析工作的主要特点就是什么? 4.初步调查的内容主要有哪些? 5.可行性研究的目的就是什么?

6.可行性研究主要从哪几个方面去考察?简述其内容。 第4章 1.简述需求分析中现行系统调查、新系统逻辑方案的提出等活动的详细内容、关键问题、主要成果及其描述方法。 2.为什么数据流图要分层? 3.简述分层数据流图的组成与基本符号以及绘制步骤。 4.简述数据词典在需求分析中的作用与编写数据词典的基本要求。 5.什么就是基本加工?描述表达基本加工逻辑功能的结构化工具有那些?特点 就是什么? 6.某银行发放贷款原则如下: (1)对于贷款未超过限额的客户,允许立即贷款; (2)对于贷款已超过限额的客户,若过去还款记录好且本次贷款额在2万元以下,可作出贷款安排,否则拒绝贷款。 请用结构化语言、决策表来描述该原则。 7.依据如下决策表,画出决策树。 信件收费决策表 8.下面就是对银行取款活动的描述: 储户携带存折前去银行,把存折与填好的取款单一并交给银行工作人员检验。工作人员需核对帐目,发现存折有效性问题、取款单填写问题或就是存折、

操作系统原理练习题附答案

《操作系统原理》练习题 一、填空题 1. 每个进程都有一个生命周期,这个周期从__(1)__开始,到__(2)__而结束。 2. 当一个进程独占处理器顺序执行时,具有两个特性:__(3)__和可再现性。 3. 并发进程中与共享变量有关的程序段称为__(4)__。 4. 一个进程或者由系统创建,或者由__(5)__创建。 5. 一个进程的静态描述是处理机的一个执行环境,被称为__(6)__。 6. 信号量的物理意义是:信号量大于0,其值为__(7)__;信号量小于0,其绝对值为__(8)__。 7. 系统有某类资源5个,供3个进程共享,如果每个进程最多申请__(9)__个该类资源,则系统是安全的。 8. 不可中断的过程称为__(10)__。 9. 操作系统中,进程可以分为__(11)__进程和__(12)__进程两类。 10. 操作系统为用户提供两种类型的使用接口,它们是__(13)__接口和__(14)__接口。 11. 批处理操作系统中,操作员根据作业需要把一批作业的有关信息输入计算机系统,操作系统选择作业并根据__(15)__的要求自动控制作业的执行。 12. 在批处理兼分时的系统中,往往由分时系统控制的作业称为前台作业,而由批处理系统控制的作业称为__(16)__作业。 13. 采用SPOOL技术的计算机系统中,操作员只要启动__(17)__程序工作,就可以把作业存放到__(18)__中等待处理。 14. 作业控制方式有__(19)__方式和__(20)__方式二种。 15. 对资源采用抢夺式分配可以防止死锁,能对处理器进行抢夺式分配的算法有__(21)__算法和__(22)__算法。 16. 因争用资源产生死锁的必要条件是互斥、__(23)__、不可抢占和__(24)__。 17. 死锁的形成,除了与资源的__(25)__有关外,也与并发进程的__(26)__有关。 18. 为破坏进程循环等待条件,从而防止死锁,通常采用的方法是把系统中所有资源类进行__(27)__,当任何一个进程申请两个以上资源时,总是要求按对应资源号__(28)__次序申请这些资源。 19. 内存管理的核心问题是如何实现__(29)__的统一,以及它们之间的__(30)__问题。 20. 页式存储管理中,处理器设置的地址转换机构是__(31)__寄存器。 21. 在页式和段式存储管理中,__(32)__存储管理提供的逻辑地址是连续的。 22. 实现地址重定位或地址映射的方法有两种:__(33)__和__(34)__。 23. 在响应比最高者优先的作业调度算法中,当各个作业等待时间相同时,__(35)__的作业将得到优先调度;当各个作业要求运行的时间相同时,__(36)__的作业得到优先调度。 24. 确定作业调度算法时应注意系统资源的均衡使用,即使CPU繁忙的作业和__(37)__的作业搭配使用。 25. 按照组织形式分类文件,可以将文件分为普通文件、目录文件和__(38)__。 26. 文件系统为用户提供了__(39)__的功能,以使得用户能透明地存储访问文件。 27. 文件名或记录名与物理地址之间的转换通过__(40)__实现。 28. 文件的__(41)__与文件共享、保护和保密紧密相关。

分布式系统试题及答案

分布式系统复习题库及答案 1、计算机系统的硬件异构性、软件异构性主要表现在哪几方面? 参考答案: 计算机系统的硬件异构性主要有三个方面的表现,即: ①计算机的指令系统不同。这意味着一种机器上的程序模块不能在另一种不兼容的机器上执行,很显然,一种机器上的可执行代码程序不能在另一种不兼容的机器上执行。 ②数据表示方法不同。例如不同类型的计算机虽然都是按字节编址的,但是高字节和低字节的规定可能恰好相反。浮点数的表示方法也常常不一样。 ③机器的配置不同。尽管机器的类型可能相同,其硬件配置也可以互不兼容。 计算机系统的软件异构性包括操作系统异构性和程序设计语言异构性。 操作系统异构性的三个主要表现方面为: ①操作系统所提供的功能可能大不相同。例如,不同的操作系统至少提供了不同的命令集。 ②操作系统所提供的系统调用在语法、语义和功能方面也不相同。 ③文件系统不同。 程序设计语言的异构性表现在不同的程序设计语言用不同方法在文件中存储数据。 2、由于分布计算系统包含多个(可能是不同种类的)分散的、自治的处理资源,要想把它们组织成一个整体,最有效地完成一个共同的任务,做到这一点比起传统的集中式的单机系统要困难得多,需要解决很多新问题。这些问题主要表现在哪些方面? 参考答案: ①资源的多重性带来的问题。由于处理资源的多重性,分布计算系统可能产生的差错类型和次数都比集中式单机系统多。最明显的一个例子是部分失效问题:系统中某一个处理资源出现故障而其他计算机尚不知道,但单机系统任何一部分出现故障时将停止整个计算。另一个例子是多副本信息一致性问题。可见,资源多重性使得差错处理和恢复问题变得很复杂。资源多重性还给系统资源管理带来新的困难。 ②资源的分散性带来的问题。在分布计算系统中,系统资源在地理上是分散的。由于进程之间的通信采用的是报文传递的方式进行的,通信将产生不可预测的、有时是巨大的延迟,特别是在远程网络所组成的分布计算系统中更是这样。例如使用卫星通信会产生270毫秒的延迟。在分布计算系统中,系统的状态信息分布在各个分散的节点上。分布式的状态信息和不可预知的报文延迟使得系统的控制和同步问题变得很复杂,要想及时地、完整地搜集到系统各方面的信息是很困难的,从而使处理机进行最佳调度相当困难。 ③系统的异构性带来的问题。在异构性分布计算系统中,由于各种不同资源(特别是计算机和网络)的数据表示和编码、控制方式等均不相同,这样一来就产生了翻译、命名、保护和共享等新问题。 由于上述原因,分布计算系统的研制,特别是软件的验证、调试、测量和维护问题变得很复杂。这些正是分布计算系统研制者要解决的主要问题。 3、分布式计算系统具有透明性时,系统有什么主要优点? 参考答案: 系统具有透明性时有以下一些优点: ①使软件的研制变得容易,因为访问资源的方法只有一种,软件的功能与其位置无关。 ②系统的某些资源变动时不影响或较少影响应用软件。

同济大学通信系统原理(英文班)练习题附答案

Chapter 1 Homework: Fill-in Questions: log M) bits 1. In a M-ary communication system, each symbol contains ( 2 information content. 2. The purpose of communication is to ( transfer information ). Efficiency of the digital communication system can be measured by the specifications such as (R B) , (R b) , ( η). And reliability can be measured by ( P e) , (P b). 3. The basic factors for measuring the merit of a communication system are (efficiency ), and ( reliability ). 4. The main influence of constant parameter channel on signal transmission are usually described by their ( Amplitude-Frequency ) and ( Phase-Frequency ) characteristics. 5. Common characteristics of random parameter channels are (transmission attenuation of the signal is varying with time ), (transmission delay of the signal varies with time ), and (signal arrives at the receiver over several paths ). Multiple-Choice Questions: 1.For analog and digital communications, which is (are) true? ( A B C D ). A. digital communication typically uses more bandwidth. B. analog communication cares more about fidelity C. digital communication cares more about probability for correct decision D. digital communication typically uses analog carrier to carry baseband signals

管理信息系统课后题答案

管理信息系统课后题答案(1-12章)第一章1.1什么是信息?信息和数据有何区别?答:(1)信息是关于客观事实的可通信的知识。首先,信息是客观世界各种事物的特征的反映,其次,信息是可以通信的最后,信息形成知识。(2)信息的概念不同于数据。数据是记录客观事物的,可鉴别的符号,这些符号不仅包括数字还包括字符,文字,图形等。数据经过处理仍然是数据。处理数据是为了更好地解释。只有经过解释,数据才有意义,才成为信息。可以说,信息是经过加工之后,对客观世界产生影响的数据。同一数据,每个人的解释可能不同,其对决策的影响也可能不同。决策者利用经过处理的数据作出决策,可能取得成功,也可能遭受失败,关键在于对数据的解释是否正确,因为不同的解释往往来自不同的背景和目的。1.2试述信息流与物流、资金流、事物流的关系。答:(1)组织中各项活动表现为物流、资金流、事物流和信息流的流动。①物流是实物的流动的过程。②资金流是伴随物流而发生的资金的流动的过程。③事物流是各项管理活动的工作流程。④信息流伴随以上各种流的流动而流动,它既是其他各种流的表现和描述,又是用于掌握、指挥和控制其他流运动的软资源。(2)信息流处于特殊地位:①伴随物流、资金流、事物流产生而产生。②是各种流控制的依据和基础。1.3如何理解人是信息的重要载体和信息意义的解释者?答:信息系统包括信息处理系统和信息传输系统两个方面。信息处理系统对数据进行处理,使它获得新的结构与形态或者产生新的数据。由于信息的作用只有在广泛交流中才能充分发挥出来,因此,通信技术的发展极大地促进了信息系统的发展。广义的信息系统概念已经延伸到与通信系统相等同。这里的通信不仅是通讯,而且意味着人际交流和人际沟通,其中包含思想的沟通,价值观的沟通和文化的沟通。广义的沟通系统强调“人”本身不仅是一个重要的沟通工具,还是资讯意义的阐述者,所有的沟通媒介均需要使资讯最终可为人类五官察觉与阐述,方算是资讯的沟通媒介。1.4什么是信息技术?信息技术在哪些方面能给管理提供支持?答:广义而言,信息技术是指能充分利用与扩展人类信息器官功能的各种方法、工具与技能的总和。该定义强调的是从哲学上阐述信息技术与人的本质关系。中义而言,信息技术是指对信息进行采集、传输、存储、加工、表达的各种技术之和。该定义强调的是人们对信息技术功能与过程的一般理解。狭义而言,信息技术是指利用计算机、网络、广播电视等各种硬件设备及软件工具与科学方法,对文图声像各种信息进行获取、加工、存储、传输与使用的技术之和。该定义强调的是信息技术的现代化与高科技含量。信息技术对计划职能的支持;对组织职能和领导职能的支持;对控制职能的支持。由此可见,信息系统对管理具有重要的辅助和支持作用,现代管理要依靠信息系统来实现其管理职能,管理思想和管理方法。1.5为什么说管理信息系统并不能解决管理中的所有问题? 答:管理是一种复杂的获得,它既涉及客观环境,又涉及人的主观因素。由于生产和社会环境的复杂性,也由于事物之间复杂的相互联系和事物的多变性,等等原因,人们在解决管理问题时不可能掌握所有的数据,更不可能把所有的,待选择的解决方案都考虑进去,而管理信息系统解决问题时运行的程序是由人来编写的。管理信息系统是一个人机结合的系统,人不能解决的问题,依靠计算机也无法决,因此仅靠管理信息系统是无法解决管理中的所有问题的。可以说,管理不 仅是一门科学更是一门艺术,人们在实施管理的时候,不仅要运用这种科学的方法,还要运用一套技术和处理方式,这些都是管理信息系统所不能及的。1.6为什么说信息系统的建立、发展和开发与使用信息系统的人的行为有紧密的联系?答:管理信息系统能否开发好,使用好与人的行为有极为密切的联系。例如,如果管理人员不愿意用信息系统,或者单位的领导不重视,不积极领导系统的开发和应用,不认真宣传和组织职工学校和使用管理信息系统,或者开发人员和管理人员不能接纳和紧密配合共同进行开发,那么,即使该管理信息系统在技术上是很过硬的,也是很难运行好的。当管理人员很担心使用计算机后,自己的工作

相关文档
最新文档