Differences between Mac, Windows, UNIX
MacOS (up until osX, anyhow) was single-user and (technically) did not have multitasking capabilites (some people will try to tell you that the mac has "cooperative multitasking", but I wouldn't even cosider that multitasking, since it requires each running program to voluntarily pause and wait for others to run).
Windows, starting with Win95 is a single-user, multasking OS. Although newer versions liek XP and 2000 support file permissions via EFS, the DO NOT allow multiple users to be logged in at once.
UNIX is 100% multi-user and multitasking, and is therefore inherently stable, secure, and confusing. Once you go UNIX, though, you'll never go back! UNIX (in all caps) was developed by AT&T waaaay back, Unix (no caps) usually refers to a family of operating systems (including the free-but-overrated Linux) that are based on UNIX. Solaris, BSD, OSF, SCO, and Tru64 are all flavors of Unix.
How does Windows programming differ from DOS programming?
Traditional dos programming is procedural, meaning that your program starts at one place, and steps through the code sequentially.
Windows programming is event-based, meaning that each time an event (like a button-click) occurs, a handler is invoked to produce a responce. The difference can be fustrating, since in event-driven code you can inadvertantly have several functions running simultaneously on the same data.
Windows - GUI DOS - CUI.
Windows - 32bit O.S and Dos is 16 bit O.S.
Windows - multithreading and multitasking O.S but Dos is stranger to these
concepts.
What is the advantage of Windows?
GUI, Multitasking, Multithreaded O.S.
Windows' strongest advantage over Unix is its ability to feed system adminstrators.
Microsoft made sure that Windows was crash-prone enough to keep admins employed by service providers. In addition, M$ made sure that Windows' internals are kept top-secret and are closed-source so that sysadmins have to spend literally thousands of hours trying to network them to any existing non-windows platforms, thus ensuring that the sysadmin will have plenty of work to do for the forseeable future.
(The samba project is an excellent example....those guys spent thousands of hours reverse-engineering the proprietary SMB networking protocol to do something that would have taken only a few hours with NFS.)
What does winmain and wndproc do?
Define and explain COM
COM - Component Object Model.
It is a protocol for object communication from microsoft.
COM is a binary standard on Microsoft (and some UNIX platforms) that enables objects to interoperate in a networked environment regardless of the language in which they were developed or on which computers they reside. COM allows an object to expose its functionality to other components and to host applications. It defines both how the object exposes itself and how this exposure works across processes and across networks. COM also defines the object's life cycle.
Define Query Interface, Adref, and Release.
QueryInterface : This method in IUnknown lets you query a COM object if it supports a particular interface. If the object has inplemented the requested interface, it returns a valid interface pointer.
AddRef: Used for reference counting. Adds a reference count.
Release: Used for reference counting. Subtracts a reference count.
Do COM keep track of all the object references(Accounting)?
Yes, it positively does (using AddRef and Release). AddRef has to be called by the client, though.
What is Marshalling?
Marshalling is the process of converting data into a format for transfering over the network.
When is Marshalling not necessary?
Marshalling is used when Data is to be shared amoug different COM components. Not needed when they operate isolated.
Differences between Windows 3.1, Windows 95/98, and Windows NT
Windows 3.1 : 16-bit
Windows 9x : 32-bit
Windows NT : 32-bit, more secure, users must login
What is a thread?
A thread is the smallest unit of execution (having its own program counter).
Threads are light-weight processes. Thread switching takes lesser time than process switching.
Thread is a path of execution with a process.
How is a thread different from a process?
A process runs in its own address space. No two processes share their address space.
Threads will run in the same address space of the process that owns them. Threads belonging to the same process will run in the same address space. They will also share the process's stack and heap. No two processes will share their stacks or their heaps.
Thread is a piece of execution i.e., a program
Process is a combination of Threads.
How is multithreading useful for a web server? A browser?
Web Servers are typically capable of serving multiple clients concurrently, this is achieved using Multi Threading
Maximum use of multiple treads will be made when there is more than one processor in the box.
However, on a single processor box the response time for each of the users may be better even if the overall throughput stays the same (will actually decrease slightly due to the processing time necessary to manage the threads)
Why not use multi-process for this? Why would you WANT to run a multi-process web server?
The reason you use a multi-process web server is for robustness in the face of failure. On a multithreaded server one thread can wipe out all the rest when it crashes the server. In a multi-process server only the offending process goes down. As far as speed is concerned most multi-process servers allow you to spawn at the begining any number of processes to handle requests so speed differences on a running system are not much different between multi-threading and multi-process servers.
Synchronize between threads vs. between processes?
Since threads are all part of a common process, they are much easier to sync. You could use a mutex or semaphore, but it is probably easier just to use global memory. All threads of a process can access global variables, so it can be quite easy to pass signals between them. POSIX threads support reenterant threads and joining, which always seemd like it defeated the purpose of having a thread in the first place.
Communicating between processes (or "IPC" for "Inter-Process Communication") is mostly OS-dependent. Under UNIX, pipes are probably the easiest way to do IPC. Sockets are somewhat portable, and allow communications to remote systems. There are countless other methods, of course.