I would like to write a simple C console application in windows 8 with VS2013.
For an inter thread communication I have to use a mailbox implementation like this:
#include <stdio.h>
#include <Rtk32.h>
RTKMailbox Box;
void RTKAPI TaskA(void * P)
{
int i;
printf("Task A: waiting at mailbox\n");
RTKGet(Box, &i);
printf("Task A: have received number %i\n", i);
}
void main(void)
{
int i;
printf("\n");
RTKernelInit(3);
Box = RTKCreateMailbox(sizeof(int), 1, "Test Box");
printf("Main : creating task A\n");
RTKCreateThread(TaskA, 4, 0, 0, NULL, "Task A");
printf("Main : please enter a number: ");
fflush(stdin);
scanf("%i", &i);
RTKPut(Box, &i);
printf("Main : done.\n");
}
Is there a Library for non embedded systems or what would be the best way.