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;
};