Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
lizhongxiao
OpenXG-RAN
Commits
79c7b9a8
Commit
79c7b9a8
authored
Aug 11, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-alignment-tpool' into integration_2023_w32
parents
ee8269ea
f3c2c12f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
common/utils/threadPool/thread-pool.h
common/utils/threadPool/thread-pool.h
+10
-4
No files found.
common/utils/threadPool/thread-pool.h
View file @
79c7b9a8
...
...
@@ -26,6 +26,8 @@
#define THREAD_POOL_H
#include <stdbool.h>
#include <stdint.h>
#include <malloc.h>
#include <stdalign.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/syscall.h>
...
...
@@ -64,7 +66,10 @@ typedef struct notifiedFIFO_elt_s {
oai_cputime_t
startProcessingTime
;
oai_cputime_t
endProcessingTime
;
oai_cputime_t
returnTime
;
void
*
msgData
;
// use alignas(32) to align msgData to 32b
// user data behind it will be aligned to 32b as well
// important! this needs to be the last member in the struct
alignas
(
32
)
void
*
msgData
;
}
notifiedFIFO_elt_t
;
typedef
struct
notifiedFIFO_s
{
...
...
@@ -80,14 +85,15 @@ static inline notifiedFIFO_elt_t *newNotifiedFIFO_elt(int size,
uint64_t
key
,
notifiedFIFO_t
*
reponseFifo
,
void
(
*
processingFunc
)(
void
*
))
{
notifiedFIFO_elt_t
*
ret
;
AssertFatal
(
NULL
!=
(
ret
=
(
notifiedFIFO_elt_t
*
)
calloc
(
1
,
sizeof
(
notifiedFIFO_elt_t
)
+
size
+
32
)),
"
"
);
notifiedFIFO_elt_t
*
ret
=
(
notifiedFIFO_elt_t
*
)
memalign
(
32
,
sizeof
(
notifiedFIFO_elt_t
)
+
size
)
;
AssertFatal
(
NULL
!=
ret
,
"out of memory
\n
"
);
ret
->
next
=
NULL
;
ret
->
key
=
key
;
ret
->
reponseFifo
=
reponseFifo
;
ret
->
processingFunc
=
processingFunc
;
// We set user data piece aligend 32 bytes to be able to process it with SIMD
ret
->
msgData
=
(
void
*
)((
uint8_t
*
)
ret
+
(
sizeof
(
notifiedFIFO_elt_t
)
/
32
+
1
)
*
32
);
// msgData is aligned to 32bytes, so everything after will be as well
ret
->
msgData
=
((
uint8_t
*
)
ret
)
+
sizeof
(
notifiedFIFO_elt_t
);
ret
->
malloced
=
true
;
return
ret
;
}
...
...
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