 	return result;
 }
 
-__global__ void device_method(SocketClient *d_socket_client) {
+__global__ void device_method(KernelWrapper *d_kernelWrapper) {
 
-	//d_socket_client
+	int thread_id = threadIdx.x + blockIdx.x * blockDim.x;
+	atomicExch(&d_kernelWrapper->active_thread_id, thread_id);
 
-	//int val = d_object->getValue();
-	//cuPrintf("Device object value: %d\n", val);
-	//d_object->setValue(++val);
-	//__threadfence();
+	if (d_kernelWrapper->active_thread_id == thread_id) {
+
+		int val = d_kernelWrapper->getValue(thread_id);
+		cuPrintf("Device object value: %d\n", val);
+	}
 }
 
 int main(void) {

#include <cuda_runtime.h>

// Global vars
SocketServer socket_server;
pthread_t t_socket_server;
SocketClient *host_client;

void sigint_handler(int s) {
	printf("Caught signal %d\n", s);

	host_client->sendDone();

	pthread_join(t_socket_server, NULL);
	exit(0);


	sleep(2);

	socket_client.sendDone();
	// wait for SocketServer
	pthread_join(t_socket_server, NULL);

