Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
45992e45
Commit
45992e45
authored
Apr 28, 2014
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backup threads started with realtime priority (refs #187)
parent
a6b512c8
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
60 deletions
+73
-60
src/exe/rt_bck/src/rt_bck.c
src/exe/rt_bck/src/rt_bck.c
+13
-48
src/exe/rt_qmon/src/rt_qmon.c
src/exe/rt_qmon/src/rt_qmon.c
+2
-12
src/lib/rt/src/os_cygwin/rt_proc.c
src/lib/rt/src/os_cygwin/rt_proc.c
+5
-0
src/lib/rt/src/os_freebsd/rt_proc.c
src/lib/rt/src/os_freebsd/rt_proc.c
+5
-0
src/lib/rt/src/os_linux/rt_proc.c
src/lib/rt/src/os_linux/rt_proc.c
+18
-0
src/lib/rt/src/os_macos/rt_proc.c
src/lib/rt/src/os_macos/rt_proc.c
+5
-0
src/lib/rt/src/os_openbsd/rt_proc.c
src/lib/rt/src/os_openbsd/rt_proc.c
+5
-0
src/lib/rt/src/os_templ/rt_proc.c
src/lib/rt/src/os_templ/rt_proc.c
+18
-0
src/lib/rt/src/rt_proc.h
src/lib/rt/src/rt_proc.h
+1
-0
src/msg/rt/src/rt_proc_msg.msg
src/msg/rt/src/rt_proc_msg.msg
+1
-0
No files found.
src/exe/rt_bck/src/rt_bck.c
View file @
45992e45
...
...
@@ -83,6 +83,8 @@
#include "pwr_baseclasses.h"
#include "rt_errh.h"
#include "rt_gdh.h"
#include "rt_thread.h"
#include "rt_proc.h"
#include "rt_gdh_msg.h"
#include "rt_bckdef.h"
#include "co_cdh.h"
...
...
@@ -1389,15 +1391,9 @@ pwr_tUInt32 bck_init ()
pwr_tBoolean
local
;
pwr_tOName
name
;
pwr_tDlid
dlid
;
pthread_t
thr_file
;
pthread_t
thr_coll
[
2
];
thread_s
thr_file
;
thread_s
thr_coll
[
2
];
pwr_sAttrRef
attrref
;
#ifdef OS_VMS
$
DESCRIPTOR
(
efcname
,
BCK_EFC_NAME
);
#endif
#if defined OS_POSIX
pthread_attr_t
attr
;
#endif
/* Create and initialize all memory structures */
...
...
@@ -1432,6 +1428,7 @@ pwr_tUInt32 bck_init ()
/* This should eventually use Posix 1003.4 signals */
#ifdef OS_ELN
BCK_MAP_AREAS
;
#elif defined OS_VMS
sts
=
sys
$
ascefc
(
BCK_EFC
,
&
efcname
,
0
,
0
);
if
(
EVEN
(
sts
))
lib
$
signal
(
sts
);
/* BUG */
...
...
@@ -1480,51 +1477,16 @@ pwr_tUInt32 bck_init ()
/* Activate the disk process
Activate the fast and slow cycle processes */
#if defined OS_ELN || (defined OS_VMS && !defined(PTHREAD_1003_1C))
sts4a
=
pthread_create
(
&
thr_file
,
pthread_attr_default
,
bck_file_process
,
NULL
);
check4a
(
sts4a
,
"pthread_create thr_file"
);
for
(
c
=
0
;
c
<
2
;
c
++
)
{
sts4a
=
pthread_create
(
&
thr_coll
[
c
],
pthread_attr_default
,
bck_coll_process
,
(
void
*
)
c
);
check4a
(
sts4a
,
"pthread_create thr_coll"
);
}
#elif defined(OS_VMS) && defined(PTHREAD_1003_1C)
sts4a
=
pthread_create
(
&
thr_file
,
NULL
,
bck_file_process
,
NULL
);
sts4a
=
thread_Create
(
&
thr_file
,
"bck_file"
,
bck_file_process
,
NULL
);
check4a
(
sts4a
,
"pthread_create thr_file"
);
for
(
c
=
0
;
c
<
2
;
c
++
)
{
sts4a
=
pthread_create
(
&
thr_coll
[
c
],
NULL
,
bck_coll_process
,
(
void
*
)
c
);
check4a
(
sts4a
,
"pthread_create thr_coll"
);
}
#elif defined OS_LYNX && defined(PWR_LYNX_30)
pthread_attr_create
(
&
attr
);
sts4a
=
pthread_create
(
&
thr_file
,
attr
,
bck_file_process
,
NULL
);
check4a
(
sts4a
,
"pthread_create thr_file"
);
for
(
c
=
0
;
c
<
2
;
c
++
)
{
sts4a
=
pthread_create
(
&
thr_coll
[
c
],
attr
,
bck_coll_process
,
(
void
*
)
c
);
check4a
(
sts4a
,
"pthread_create thr_coll"
);
}
#elif defined OS_POSIX
pthread_attr_init
(
&
attr
);
sts4a
=
pthread_create
(
&
thr_file
,
&
attr
,
bck_file_process
,
NULL
);
check4a
(
sts4a
,
"pthread_create thr_file"
);
for
(
c
=
0
;
c
<
2
;
c
++
)
{
sts4a
=
pthread_create
(
&
thr_coll
[
c
],
&
attr
,
bck_coll_process
,
(
void
*
)(
long
)
c
);
char
name
[
20
];
sprintf
(
name
,
"bck_coll%d"
,
c
);
sts4a
=
thread_Create
(
&
thr_coll
[
c
],
name
,
bck_coll_process
,
(
void
*
)(
long
)
c
);
check4a
(
sts4a
,
"pthread_create thr_coll"
);
}
#endif
return
sts
;
}
/* bck_init */
...
...
@@ -1550,6 +1512,9 @@ int main( int argc, char *argv[])
}
}
/* Wait for scheduler to be set */
proc_SchedWait
();
errh_Init
(
"pwr_bck"
,
errh_eAnix_bck
);
errh_SetStatus
(
PWR__SRVSTARTUP
);
...
...
src/exe/rt_qmon/src/rt_qmon.c
View file @
45992e45
...
...
@@ -78,6 +78,7 @@
#include "rt_lst.h"
#include "rt_que.h"
#include "rt_thread.h"
#include "rt_proc.h"
#include "rt_thread_msg.h"
#include "rt_pwr_msg.h"
#include "rt_ini_event.h"
...
...
@@ -357,8 +358,6 @@ main (int argc, char *argv[])
qcom_sQid
qid
=
qdb_cQexport
;
qcom_sQid
neth_qid
;
qcom_sQid
my_q
=
qcom_cNQid
;
pid_t
pid
;
int
count
=
0
;
int
noneth
=
0
;
/* Vnta en stund ... */
...
...
@@ -368,16 +367,7 @@ main (int argc, char *argv[])
noneth
=
1
;
/* Wait for scheduler to be set */
#if defined OS_LINUX
pid
=
getpid
();
while
((
sched_getscheduler
(
pid
)
==
SCHED_OTHER
)
&&
(
count
<
5
))
{
sleep
(
1
);
count
++
;
}
#endif
proc_SchedWait
();
errh_Init
(
"pwr_qmon"
,
errh_eAnix_qmon
);
errh_SetStatus
(
PWR__SRVSTARTUP
);
...
...
src/lib/rt/src/os_cygwin/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,8 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
return
PROC__SUCCESS
;
}
src/lib/rt/src/os_freebsd/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,8 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
return
PROC__SUCCESS
;
}
src/lib/rt/src/os_linux/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,21 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
pid_t
pid
;
int
count
=
0
;
int
sched
;
pid
=
getpid
();
while
(((
sched
=
sched_getscheduler
(
pid
))
==
SCHED_OTHER
)
&&
(
count
<
5
))
{
sleep
(
1
);
count
++
;
}
if
(
sched
==
SCHED_OTHER
)
return
PROC__NOSCHED
;
return
PROC__SUCCESS
;
}
src/lib/rt/src/os_macos/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,8 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
return
PROC__SUCCESS
;
}
src/lib/rt/src/os_openbsd/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,8 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
return
PROC__SUCCESS
;
}
src/lib/rt/src/os_templ/rt_proc.c
View file @
45992e45
...
...
@@ -124,3 +124,21 @@ proc_UnloadProgram (
return
sts
;
}
pwr_tStatus
proc_SchedWait
()
{
pid_t
pid
;
int
count
=
0
;
int
sched
;
pid
=
getpid
();
while
(((
sched
=
sched_getscheduler
(
pid
))
==
SCHED_OTHER
)
&&
(
count
<
5
))
{
sleep
(
1
);
count
++
;
}
if
(
sched
==
SCHED_OTHER
)
return
PROC__NOSCHED
;
return
PROC__SUCCESS
;
}
src/lib/rt/src/rt_proc.h
View file @
45992e45
...
...
@@ -94,6 +94,7 @@ pwr_tStatus proc_UnloadProgram (proc_sProcess*);
pwr_tStatus
proc_RegisterObject
(
pwr_tOid
);
pwr_tStatus
proc_TimeStamp
();
pwr_tStatus
proc_SchedWait
();
#endif
...
...
src/msg/rt/src/rt_proc_msg.msg
View file @
45992e45
...
...
@@ -42,4 +42,5 @@ timedout <call has timed out> /info
insvirmem <insufficient virtual memory> /error
nyi <not yet implemented> /error
anix <zero errh_eAnix> /error
nosched <scheduler not set> /error
.end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment