mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-06 04:40:02 +02:00
Printing thread Ids created and exited, others (if others) are zmqs internal threading, moved all zmq socket type to publish subscriber type: (non blocking in send if no client) as per Aldos gui and probably faster, as only clients to receiver standard impl is aldos gui/slsDetectorGui/xiaoqiangs call back via detector class
This commit is contained in:
parent
960dc5c62f
commit
2d52058a55
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsReceiverSoftware
|
Path: slsDetectorsPackage/slsReceiverSoftware
|
||||||
URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
URL: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
||||||
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_receiver_software.git
|
||||||
Repsitory UUID: 1102ff107a9d19583f85fde2b7eddbe7e9b50715
|
Repsitory UUID: ec1b8333034e4a09d819b2317994813435c7159f
|
||||||
Revision: 648
|
Revision: 651
|
||||||
Branch: 3.0-rc
|
Branch: 3.0
|
||||||
Last Changed Author: Dhanya_Maliakal
|
Last Changed Author: Dhanya_Maliakal
|
||||||
Last Changed Rev: 653
|
Last Changed Rev: 656
|
||||||
Last Changed Date: 2017-08-18 18:24:30.000000002 +0200 ./src/Listener.cpp
|
Last Changed Date: 2017-08-24 14:09:36.000000002 +0200 ./src/Fifo.cpp
|
||||||
|
@ -63,13 +63,18 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// create publisher
|
// create publisher
|
||||||
socketDescriptor = zmq_socket (contextDescriptor, ZMQ_PULL);
|
socketDescriptor = zmq_socket (contextDescriptor, ZMQ_SUB);
|
||||||
if (socketDescriptor == NULL) {
|
if (socketDescriptor == NULL) {
|
||||||
PrintError ();
|
PrintError ();
|
||||||
Close ();
|
Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Socket Options provided above
|
//Socket Options provided above
|
||||||
|
// an empty string implies receiving any messages
|
||||||
|
if ( zmq_setsockopt(socketDescriptor, ZMQ_SUBSCRIBE, "", 0)) {
|
||||||
|
PrintError ();
|
||||||
|
Close();
|
||||||
|
}
|
||||||
//ZMQ_LINGER default is already -1 means no messages discarded. use this options if optimizing required
|
//ZMQ_LINGER default is already -1 means no messages discarded. use this options if optimizing required
|
||||||
//ZMQ_SNDHWM default is 0 means no limit. use this to optimize if optimizing required
|
//ZMQ_SNDHWM default is 0 means no limit. use this to optimize if optimizing required
|
||||||
// eg. int value = -1;
|
// eg. int value = -1;
|
||||||
@ -104,7 +109,7 @@ public:
|
|||||||
if (contextDescriptor == NULL)
|
if (contextDescriptor == NULL)
|
||||||
return;
|
return;
|
||||||
// create publisher
|
// create publisher
|
||||||
socketDescriptor = zmq_socket (contextDescriptor, ZMQ_PUSH);
|
socketDescriptor = zmq_socket (contextDescriptor, ZMQ_PUB);
|
||||||
if (socketDescriptor == NULL) {
|
if (socketDescriptor == NULL) {
|
||||||
PrintError ();
|
PrintError ();
|
||||||
Close ();
|
Close ();
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//#define SVNPATH ""
|
//#define SVNPATH ""
|
||||||
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git"
|
#define SVNURL "git@git.psi.ch:sls_detectors_software/sls_receiver_software.git"
|
||||||
//#define SVNREPPATH ""
|
//#define SVNREPPATH ""
|
||||||
#define SVNREPUUID "1102ff107a9d19583f85fde2b7eddbe7e9b50715"
|
#define SVNREPUUID "ec1b8333034e4a09d819b2317994813435c7159f"
|
||||||
//#define SVNREV 0x653
|
//#define SVNREV 0x656
|
||||||
//#define SVNKIND ""
|
//#define SVNKIND ""
|
||||||
//#define SVNSCHED ""
|
//#define SVNSCHED ""
|
||||||
#define SVNAUTH "Dhanya_Maliakal"
|
#define SVNAUTH "Dhanya_Maliakal"
|
||||||
#define SVNREV 0x653
|
#define SVNREV 0x656
|
||||||
#define SVNDATE 0x20170818
|
#define SVNDATE 0x20170824
|
||||||
//
|
//
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "ThreadObject.h"
|
#include "ThreadObject.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <syscall.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
@ -74,6 +75,7 @@ void* ThreadObject::StartThread(void* thisPointer) {
|
|||||||
|
|
||||||
|
|
||||||
void ThreadObject::RunningThread() {
|
void ThreadObject::RunningThread() {
|
||||||
|
bprintf(BLUE,"Created [ %s Thread %d, Tid: %ld ]\n", GetType().c_str(),index, (long)syscall(SYS_gettid));
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
while(IsRunning()) {
|
while(IsRunning()) {
|
||||||
@ -87,7 +89,7 @@ void ThreadObject::RunningThread() {
|
|||||||
sem_wait(&semaphore);
|
sem_wait(&semaphore);
|
||||||
|
|
||||||
if(killThread) {
|
if(killThread) {
|
||||||
bprintf(BLUE,"%s Thread %d: Goodbye\n",GetType().c_str(),index);
|
bprintf(BLUE,"Exiting [ %s Thread %d, Tid: %ld ]\n", GetType().c_str(),index, (long)syscall(SYS_gettid));
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h> //wait
|
#include <sys/types.h> //wait
|
||||||
#include <sys/wait.h> //wait
|
#include <sys/wait.h> //wait
|
||||||
|
#include <syscall.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
|
|||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
keeprunning = true;
|
keeprunning = true;
|
||||||
bprintf(BLUE,"[ Pid: %ld ]\n", (long)getpid());
|
bprintf(BLUE,"Created [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
|
|
||||||
// Catch signal SIGINT to close files and call destructors properly
|
// Catch signal SIGINT to close files and call destructors properly
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
@ -85,6 +86,7 @@ int main(int argc, char *argv[]) {
|
|||||||
slsReceiverUsers *receiver = new slsReceiverUsers(argc, argv, ret);
|
slsReceiverUsers *receiver = new slsReceiverUsers(argc, argv, ret);
|
||||||
if(ret==slsReceiverDefs::FAIL){
|
if(ret==slsReceiverDefs::FAIL){
|
||||||
delete receiver;
|
delete receiver;
|
||||||
|
bprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,6 +135,7 @@ int main(int argc, char *argv[]) {
|
|||||||
//start tcp server thread
|
//start tcp server thread
|
||||||
if (receiver->start() == slsReceiverDefs::FAIL){
|
if (receiver->start() == slsReceiverDefs::FAIL){
|
||||||
delete receiver;
|
delete receiver;
|
||||||
|
bprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +145,7 @@ int main(int argc, char *argv[]) {
|
|||||||
usleep(5 * 1000 * 1000);
|
usleep(5 * 1000 * 1000);
|
||||||
|
|
||||||
delete receiver;
|
delete receiver;
|
||||||
|
bprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
FILE_LOG(logINFO) << "Goodbye!";
|
FILE_LOG(logINFO) << "Goodbye!";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <syscall.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ void* slsReceiverTCPIPInterface::startTCPServerThread(void *this_pointer){
|
|||||||
|
|
||||||
|
|
||||||
void slsReceiverTCPIPInterface::startTCPServer(){
|
void slsReceiverTCPIPInterface::startTCPServer(){
|
||||||
|
bprintf(BLUE,"Created [ TCP server Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
|
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
FILE_LOG(logDEBUG5) << "Starting Receiver TCP Server";
|
FILE_LOG(logDEBUG5) << "Starting Receiver TCP Server";
|
||||||
@ -221,6 +222,7 @@ void slsReceiverTCPIPInterface::startTCPServer(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
mySock->exitServer();
|
mySock->exitServer();
|
||||||
|
bprintf(BLUE,"Exiting [ TCP server Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +233,7 @@ void slsReceiverTCPIPInterface::startTCPServer(){
|
|||||||
receiverBase->shutDownUDPSockets();
|
receiverBase->shutDownUDPSockets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bprintf(BLUE,"Exiting [ TCP server Tid: %ld ]\n", (long)syscall(SYS_gettid));
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user