To be added to
wikipedia: "Peer-to-peer (P2P) computing or networking is a distributed application architecture that partitions tasks or
workloads between peers. Peers are equally privileged, equipotent participants in the application. They are said to
form a peer-to-peer network of nodes."
We often wish to test Peer to Peer functionality.
The peers use the services of others to communicate. TCP is over IP.
The IVT / Functional testers often have asynchronous event detection to handle the lower layers while the Functional Testing does a Send, Wait message sequence.
To have multiple Send Wait process, you need process switching or forking. Each process normally needs it's own stack.
In simple micro processors, co-operative multi tasking is used.
Split each process into chunks which can be moved on by executing small chunks of code when an event is detected. It is thought that you have to use interrupts, to do this, but polling around a list of possible sources is also possible.
Naming is important here to show the structure.
concious - single task, possibly swapping between many tasks
sub concious - multi tasking
Consider Traffic as a spectrum.
A spectrum analyser can be implemented by many filters and power detectors.
The signal is split by filters into channels which have bandwidth.
What are the "bandwidths"? What units are they?
The power can be expressed as "Calls per second", but what are the Bandwidth units. The channels could be loads of different classifications.
Windows is event driven software.
Events can arrive asynchronously from a number of sources and need to be responded to.
How do you lay out the source code?
SDL diagrams are often shown Processes, state, Event. See ITU Q.703 ( http://www.itu.int/rec/T-REC-Q.703/en/) and Q.704 ( http://www.itu.int/rec/T-REC-Q.704-199607-I/E )
Code could be laid out Processes, Event, State.
Delphi tends to lay out by order of creation, with event handlers added as declared.
LUA IUP ( http://www.tecgraf.puc-rio.br/iup/ ) allows handlers to be added in any order.
Bloodnet CPP produces a default windows application which shows a main loop with get message and despatcher function.