Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
d866979a
"devices/SDP.py" did not exist on "347f9da2af282f77df20cbff734a1d7a63398c7e"
Commit
d866979a
authored
16 years ago
by
John Romein
Browse files
Options
Downloads
Patches
Plain Diff
bug 225:
Terminates properly with interrupts. Still unstable.
parent
83675e4d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RTCP/FCNP/src/fcnp_ion.cc
+27
-2
27 additions, 2 deletions
RTCP/FCNP/src/fcnp_ion.cc
with
27 additions
and
2 deletions
RTCP/FCNP/src/fcnp_ion.cc
+
27
−
2
View file @
d866979a
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include
<vector>
#include
<vector>
#include
<pthread.h>
#include
<pthread.h>
#include
<signal.h>
#include
"fcnp_ion.h"
#include
"fcnp_ion.h"
#include
"protocol.h"
#include
"protocol.h"
...
@@ -108,7 +109,7 @@ static int fd;
...
@@ -108,7 +109,7 @@ static int fd;
static
_BGP_Atomic
sendMutex
=
{
0
};
static
_BGP_Atomic
sendMutex
=
{
0
};
static
pthread_mutex_t
scheduledRequestsLock
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
scheduledRequestsLock
=
PTHREAD_MUTEX_INITIALIZER
;
static
Semaphore
recvSema
(
1
);
// could have used mutex, but this is slower!??? livelock???
static
Semaphore
recvSema
(
1
);
// could have used mutex, but this is slower!??? livelock???
static
volatile
bool
stop
;
static
volatile
bool
stop
,
stop
ped
;
// Reading the tree status words seems to be expensive. These wrappers
// Reading the tree status words seems to be expensive. These wrappers
...
@@ -374,6 +375,7 @@ static void *pollThread(void *)
...
@@ -374,6 +375,7 @@ static void *pollThread(void *)
if
(
useInterrupts
)
if
(
useInterrupts
)
std
::
clog
<<
"received "
<<
nrInterrupts
<<
" vc0 interrupts"
<<
std
::
endl
;
std
::
clog
<<
"received "
<<
nrInterrupts
<<
" vc0 interrupts"
<<
std
::
endl
;
stopped
=
true
;
return
0
;
return
0
;
}
}
...
@@ -564,11 +566,26 @@ static void drainFIFO()
...
@@ -564,11 +566,26 @@ static void drainFIFO()
static
pthread_t
thread
;
static
pthread_t
thread
;
static
void
sigHandler
(
int
)
{
}
void
init
(
bool
enableInterrupts
)
void
init
(
bool
enableInterrupts
)
{
{
if
(
enableInterrupts
)
if
(
enableInterrupts
)
{
std
::
clog
<<
"Warning: FCNP with interrupts is not stable!"
<<
std
::
endl
;
std
::
clog
<<
"Warning: FCNP with interrupts is not stable!"
<<
std
::
endl
;
struct
sigaction
sa
;
sigemptyset
(
&
sa
.
sa_mask
);
sa
.
sa_flags
=
0
;
sa
.
sa_handler
=
sigHandler
;
if
(
sigaction
(
SIGUSR1
,
&
sa
,
0
)
!=
0
)
perror
(
"sigaction"
);
}
useInterrupts
=
enableInterrupts
;
useInterrupts
=
enableInterrupts
;
//setAffinity();
//setAffinity();
...
@@ -586,6 +603,14 @@ void end()
...
@@ -586,6 +603,14 @@ void end()
{
{
stop
=
true
;
stop
=
true
;
if
(
useInterrupts
)
while
(
!
stopped
)
{
if
(
pthread_kill
(
thread
,
SIGUSR1
)
!=
0
)
perror
(
"pthread_kill"
);
usleep
(
25000
);
}
if
(
pthread_join
(
thread
,
0
)
!=
0
)
{
if
(
pthread_join
(
thread
,
0
)
!=
0
)
{
perror
(
"pthread_join"
);
perror
(
"pthread_join"
);
exit
(
1
);
exit
(
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment