Skip to content

kevinjoseph1995/pika

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pika: A basic message passing library

An experimental self learning project.

Usage:

Inter-process

Producer side on process 1
auto const params = pika::ChannelParameters {
        .channel_name = "/test", .queue_size = 4, .channel_type = pika::ChannelType::InterProcess
};
auto producer = pika::Channel::CreateProducer<int>(params);
producer->Connect();
producer->Send(44);
Consumer side on process 2
auto const params = pika::ChannelParameters {
        .channel_name = "/test", .queue_size = 4, .channel_type = pika::ChannelType::InterProcess
};
auto consumer = pika::Channel::CreateConsumer<int>(params);
consumer->Connect();
int recv_packet {};
consumer->Receive(recv_packet);
assert(recv_packet == 44);

Single producer single consumer lockfree inter thread channel implementation

Producer on Thread 1
auto const params = pika::ChannelParameters { .channel_name = "/test",
        .queue_size = 1,
        .channel_type = pika::ChannelType::InterThread,
        .single_producer_single_consumer_mode = true
};
auto producer = pika::Channel::CreateProducer<int>(params);
producer->Connect();
producer->Send(44);
Consumer on Thread 2
auto const params = pika::ChannelParameters { .channel_name = "/test",
        .queue_size = 1,
        .channel_type = pika::ChannelType::InterThread,
        .single_producer_single_consumer_mode = true
};
auto consumer = pika::Channel::CreateConsumer<int>(params);
consumer->Connect();
int recv_packet {};
consumer->Receive(recv_packet);
assert(recv_packet == 44);

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published