Milky Way
                              image  MultiverseSocial.com Milky Way
                              image            
 
Tony's Channel Paradigm overview   By Tony Swain

What is a Channel?
A Channel is an abstract multicast pipeline for data.

A Channel is non blocking
A Channel is asynchronous.
A Channel can join another Channel in parallel or daisy chain
A Channel is written in C and or Assembler

IO_THREAD_NUMBER = 4
Channel Threads

0) NetXec Base Runtime & schedule thread. (1 only)
1) Join
Join / Leave Channel thread
2) Exec
main channel runtime thread.
3) Exception
Exception thread (1 only)

0) NetXec thread
1) Join/Leave Channel thread
2) Run thread
3) Exception thread

Channels Why?  Portability; works everywhere across all hardware / address modes/ A Paradigm that WORKS with MAXIMUM efficiency and unfettered access to all machine resources & optimized in C/Assembler.

Base Channel Structure:
IO_THREAD_NUMBER = 4

struct IOBlock
{
struct Linkable node;   
struct HyperLinkedList *IORequesList;
struct Signal          io_external_signal[IO_THREAD_NUMBER]; //ATM IO_THREAD_NUMBER = 4
struct HyperLinkedList io_list[IO_THREAD_NUMBER]; //system/join/process/exception
struct NexXecThread    io_thread           [IO_THREAD_NUMBER];
void                               *io_lock             [IO_THREAD_NUMBER];  //
struct   RunInfo              thread_runinfo      [IO_THREAD_NUMBER];
};

struct Channel
{
struct Linkable        node;
int                    channel_flags;
int                    type;
int                            io_flags;
struct SignalGroup ch_signalgroup;
struct Signal           ch_signal; 
int                            pid;
char                       *name;
void (*open ) (void *);
void (*init ) (void *);
void (*pause) (void *);
void (*run  ) (void *);
void (*close) (void *);
void (*signal)(void *);
struct IOBlock io_block;
};


For NetXec Thread/Process current state monitor
Current run state definitions.
**
 
#define RT_NULL                0
#define RT_WAIT                1
#define RT_TIMEDWAIT           2
#define RT_DELAY               3
#define RT_SLEEP               4
#define RT_START               5
#define RT_STOPPING            6
#define RT_RETURNING           7
#define RT_STOPPED             8
#define RT_RUN                 9
#define RT_ZOMBIE              10
#define RT_DISABLED            11
#define RT_EXCEPTION           12
#define RT_KEYWAIT             13
#define RT_IOBLOCK             14
#define RT_INIT                15
#define RT_ACCEPTBLOCK         16
#define RT_SYNCRONIZING        17
#define RT_SYNCHRONIZE_THIS    18
#define RT_HAVE_MONITOR1       19
#define RT_HAVE_MONITOR_THIS   20
#define RT_SELECT              21
#define RT_SELECTING           22
#define RT_INITIALIZING        23
#define RT_PAUSED              24
#define RT_SHUTDOWN            25
#define RT_KICKSTART           26   //
#define RT_EXEC                27   // execing a process.
#define RT_RESERVED_END        31


struct RunInfo
{
struct Linkable node;
struct MemoryHandle *memory_handle;
volatile time_t now;            // last run
volatile time_t runLag;                 //
volatile int runFlags;
volatile int runState;          // **

volatile time_t lastRun;       // If Report Bit set
volatile time_t startTime; //
volatile time_t waitTime;
volatile long iteration;
volatile int serverFlags; //
volatile pthread_t thread;
volatile char *signal;       // 8 bits for SignalChannel / 15 bit compression;
};


//------------------SignalChannel.h ----------------------------
// NOTE: 15 bits of signal compressed into > 8 bits <
// Posix & extended signal emulation.
// Extended Signals interface definitions by Tony Swain Feb 12 2022
// This is for the SignalChannel which is part of
// "Tony's Channel Paradigm"

#define SIG_HUP    0x01
#define SIG_INT    0x02
#define SIG_QUIT   0x04     
#define SIG_KILL   0x08  // Definition Bank Zero
#define SIG_ABRT   0x20

   //---
#define SIG_USR1   0x01
#define SIG_USR2   0x02 // Definition Bank ONE
#define SIG_PIPE   0x04
#define SIG_ALRM   0x08
#define SIG_TERM   0x10
  //----
#define SIG_GPU       0x04    // Definition Bank TWO
#define SIG_PAUSE     0x08   //-- remove from
 thread shedule list
#define SIG_SHEDULE   0x10   //  add to thread shedule list
#define SIG_EXTENDED  0x20  // Use an extention block of bits
   //-----
                         //----Allocation control bits for SignalGroup.
#define SIG_BNK1   0x10  //--
#define SIG_BNK2   0x20  //-- If you use bank 2, bank 1 is a spare :)
#define SIG_USR3   0x40
#define SIG_USED   0x80  // Signal allocated bit


struct SignalGroup
{
struct HyperLinkedList *signal_list;
unsigned char reserved[512];
unsigned char current_offset;
unsigned char currrent_bit;
};

struct Signal
{
struct Linkable node;
struct SignalGroup     *parent_group;
struct HyperLinkedList *parent_list;
struct HyperLinkedLIst *replyList;   //Waiting Listeners
char *signal_byte; // points to offset in SignalGroup.reserved;
};

 
 
 
Current Channel Definitions.
// Channel type flags
//--- Backing store RAM source nibble
#define STDIO_CHANNEL             0x00000000 //-
#define STATE_MACHINE_CHANNEL     0x00000001
#define SIGNAL_CHANNEL            0x00000002
#define CLOCK_CHANNEL             0x00000003 //clock->clock_register
#define THREAD_CHANNEL            0x00000004
#define SINK_CHANNEL              0x00000005 // null write & cleanup on exit.
#define SHARED_MEMORY_CHANNEL     0x00000006
#define BACKING_STORE_CHANNEL     0x00000007  //** IPC shared memory + IO source bits.
#define STACK_CHANNEL             0x00000008  // Stack memory
#define HEAP_CHANNEL              0x00000009   //  Malloc memory
#define GPU_CHANNEL               0x00000010   // GPU IO/clock memory
#define TRANSFORM_CHANNEL         0x00000011
#define REGISTRY_CHANNEL          0x00000012  // Link to MS registry.
#define URL_CHANNEL               0x00000013  // URI fetcher.
#define CLOUD_CHANNEL             0x00000014  //
#define TELEVISION_CHANNEL        0x00000015
#define FILE_CHANNEL              0x00000016
#define CONTAINER_CHANNEL         0x00000017 // IO goes to HyperView->asynch blitter list.
#define PROCESS_CHANNEL           0x00000018 // random processing
#define ARBITRATION_CHANNEL       0x00000019 // Monitor monitor. Mutex intermediary.
#define SYSTEM_CHANNEL            0x00000020 // MetXec
#define CLI_CHANNEL               0x00000021
#define FTP_CHANNEL               0x00000022
#define ENCRYPT_CHANNEL           0x00000023
#define CHAT_CHANNEL              0x00000024
#define SHOP_CHANNEL              0x00000025
#define NEURAL_CHANNEL            0x00000026 // Neural net interface.
#define STATISTICS_CHANNEL        0x00000027 //
#define PORT_SERVER_CHANNEL 0x00000028
#define
BML_CHANNEL    0x00000029 // Binary Markup Language
#define
BQL_CHANNEL    0x00000030// Binary Query Language #define VLC_CHANNEL    0x00000031
#define AUDIO_CHANNEL  0x00000032
#define SMC_CHANNEL    x00000033 // self modified code.
#define GPRS_CHANNEL   0x00000034   // General packet radio serves,
#define USB_CHANNEL    0x00000035  //
#define GPS_CHANNEL    0x00000036
#define NIMOSINI_CHANNEL 0x00000037

// Nimosini is a Channel for AI.

Encoding
VLC_CHANNEL                      // VideoLan Control Channel 
SMC_CHANNEL                    // self modified code channel.
AUDIO_CHANNEL
GPRS_CHANNEL                   // General packet radio serves,
GPS_CHANNEL                      // NEMA
NIMOSINI_CHANNEL             // >> AI << Channel

= 1225 potential permutations of IO duplex.
 
 

Memory Types
#define HEAP_MEMORY    0       // malloc();
#define STACK_MEMORY  1       // stalloc();
#define IPC_MEMORY        2       // shalloc();
#define GPU_MEMORY      3       // galloc();
#define CLOUD_MEMORY 4       // clalloc();








-->