This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #11, exercise #1.2 | |
| #include <sys/wait.h> | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int i; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #11, exercise #1.2 | |
| #include <sys/wait.h> | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int i; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #11, exercise #1.2 | |
| #include <sys/wait.h> | |
| #include <iostream> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <cerrno> | |
| using namespace std; | |
| // Prototypes: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Publisher.hpp> | |
| #include <MessageDistributionSystem.hpp> | |
| #include <osapi/Log.hpp> | |
| static const int MAX_QUEUE_SIZE=10; | |
| Publisher::Publisher() | |
| : running_(true), | |
| mq_(MAX_QUEUE_SIZE), | |
| timer_(osapi::createNewTimer(&mq_, ID_TIME_OUT)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <osapi/Log.hpp> | |
| #include <Subscriber.hpp> | |
| #include <MessageDistributionSystem.hpp> | |
| static const int MAX_QUEUE_SIZE=10; | |
| Subscriber::Subscriber(unsigned int subId) | |
| : mq_(MAX_QUEUE_SIZE), subId_(subId) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <MessageDistributionSystem.hpp> | |
| #include <iostream> | |
| using namespace std; | |
| void MessageDistributionSystem::subscribe(const std::string& msgId, | |
| osapi::MsgQueue* mq, | |
| unsigned long id) | |
| { | |
| /* Something missing */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SubscriberId.hpp> | |
| namespace details | |
| { | |
| SubscriberId::SubscriberId(osapi::MsgQueue* mq, unsigned long id) | |
| { | |
| /* Make your own implementation here... */ | |
| // New code starts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SRCS=main.cpp KeyBoardInput.cpp LogSystem.cpp | |
| OBJS=$(SRCS:.cpp=.o) | |
| #BASEPATH=.. | |
| BASEPATH=~/Documents/Lab8/Ex1 | |
| ifeq (${TARGET},host) | |
| # We need to include host specific things | |
| #include ../compiler_setup.host | |
| include ~/Documents/Lab8/Ex1/compiler_setup.host | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Quick and very dirty! | |
| BASEPATH=~/Documents/Lab8/Ex1 | |
| # Which target? set default | |
| ifndef TARGET | |
| TARGET=host | |
| #TARGET=target | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ISU laboratory session #8, exercise #1. | |
| #include <osapi/Thread.hpp> | |
| namespace osapi | |
| { | |
| void* ThreadFunctor::threadMapper(void* thread) | |
| { | |
| /* Something is missing here - Determine what! */ | |
| // New code starts | |
| ThreadFunctor *tf = static_cast<ThreadFunctor*>(thread); |
NewerOlder