Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
018daab6
Commit
018daab6
authored
May 08, 2014
by
David COME
Browse files
Fixed all thresholds values for loopbacks : they are all in uint64_t
parent
0a5568be
Changes
3
Hide whitespace changes
Inline
Side-by-side
castor/tape/tapeserver/daemon/DiskReadThreadPool.cpp
View file @
018daab6
...
...
@@ -37,7 +37,7 @@ namespace daemon {
//------------------------------------------------------------------------------
// DiskReadThreadPool constructor
//------------------------------------------------------------------------------
DiskReadThreadPool
::
DiskReadThreadPool
(
int
nbThread
,
u
nsigned
in
t
maxFilesReq
,
u
nsigned
in
t
maxBytesReq
,
DiskReadThreadPool
::
DiskReadThreadPool
(
int
nbThread
,
u
int64_
t
maxFilesReq
,
u
int64_
t
maxBytesReq
,
castor
::
log
::
LogContext
lc
)
:
m_lc
(
lc
),
m_maxFilesReq
(
maxFilesReq
),
m_maxBytesReq
(
maxBytesReq
),
m_nbActiveThread
(
0
){
for
(
int
i
=
0
;
i
<
nbThread
;
i
++
)
{
DiskReadWorkerThread
*
thr
=
new
DiskReadWorkerThread
(
*
this
);
...
...
castor/tape/tapeserver/daemon/DiskReadThreadPool.hpp
View file @
018daab6
...
...
@@ -49,7 +49,7 @@ public:
* within a single request a single request to the task injectore
* @param lc log context fpr logging purpose
*/
DiskReadThreadPool
(
int
nbThread
,
u
nsigned
in
t
maxFilesReq
,
u
nsigned
in
t
maxBytesReq
,
DiskReadThreadPool
(
int
nbThread
,
u
int64_
t
maxFilesReq
,
u
int64_
t
maxBytesReq
,
castor
::
log
::
LogContext
lc
);
/**
...
...
@@ -119,37 +119,48 @@ private:
void
start
()
{
castor
::
tape
::
threading
::
Thread
::
start
();
}
void
wait
()
{
castor
::
tape
::
threading
::
Thread
::
wait
();
}
private:
/** Pointer to the thread pool, allowing calls to popAndRequestMore,
* and calling finish() on the task injector when the last thread
* is finishing (thanks to the actomic counter m_parent.m_nbActiveThread) */
DiskReadThreadPool
&
m_parent
;
/** The sequential ID of the thread, used in logs */
const
int
m_threadID
;
/** The local copy of the log context, allowing race-free logging with context
between threads. */
castor
::
log
::
LogContext
m_lc
;
/** The execution thread: pops and executes tasks (potentially asking for
more) and calls task injector's finish() on exit of the last thread. */
virtual
void
run
();
};
/** Container for the threads */
std
::
vector
<
DiskReadWorkerThread
*>
m_threads
;
/** The queue of pointer to tasks to be executed. We own the tasks (they are
* deleted by the threads after execution) */
castor
::
tape
::
threading
::
BlockingQueue
<
DiskReadTask
*>
m_tasks
;
/** The log context. This is copied on construction to prevent interferences
* between threads.
*/
castor
::
log
::
LogContext
m_lc
;
/** Pointer to the task injector allowing request for more work, and
* termination signal
l
ing */
* termination signaling */
MigrationTaskInjector
*
m_injector
;
/** The maximum number of files we ask per request. This value is also used as
* a thre
a
shold (half of it, indeed) to trigger the request for more work.
* a threshold (half of it, indeed) to trigger the request for more work.
* Another request for more work is also triggered when the task FIFO gets empty.*/
const
uint64_t
m_maxFilesReq
;
/** Same as m_maxFilesReq for size per request. */
/** Same as m_maxFilesReq for size per request. */
const
uint64_t
m_maxBytesReq
;
/** An atomic (i.e. thread safe) counter of the current number of thread (they
are counted up at creation time and down at completion time) */
tape
::
threading
::
AtomicCounter
<
int
>
m_nbActiveThread
;
...
...
castor/tape/tapeserver/daemon/MigrationTaskInjector.hpp
View file @
018daab6
...
...
@@ -123,14 +123,14 @@ private:
*/
class
Request
{
public:
Request
(
int
mf
,
int
mb
,
bool
lc
)
:
Request
(
u
int
64_t
mf
,
u
int
64_t
mb
,
bool
lc
)
:
nbMaxFiles
(
mf
),
byteSizeThreshold
(
mb
),
lastCall
(
lc
),
end
(
false
)
{}
Request
()
:
nbMaxFiles
(
-
1
),
byteSizeThreshold
(
-
1
),
lastCall
(
true
),
end
(
true
)
{}
const
int
nbMaxFiles
;
const
int
byteSizeThreshold
;
const
u
int
64_t
nbMaxFiles
;
const
u
int
64_t
byteSizeThreshold
;
/**
* True if it is the last call for the set of requests :it means
...
...
@@ -182,10 +182,10 @@ private:
*/
castor
::
tape
::
threading
::
AtomicFlag
m_errorFlag
;
/// maxim
al
number of files
requested. at once
///
The
maxim
um
number of files
we ask per request.
const
uint64_t
m_maxFiles
;
///
maximal number of cumulated byte requested. at once
///
Same as m_maxFilesReq for size per request. (in bytes))
const
uint64_t
m_maxByte
;
/**The last fseq used on the tape. We should not see this but
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment