Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dCache
cta
Commits
b4d41a27
Commit
b4d41a27
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Deleted unused file ForkedProcessPool.hpp
parent
d32b06e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tapeserver/castor/server/ForkedProcessPool.hpp
+0
-110
0 additions, 110 deletions
tapeserver/castor/server/ForkedProcessPool.hpp
with
0 additions
and
110 deletions
tapeserver/castor/server/ForkedProcessPool.hpp
deleted
100644 → 0
+
0
−
110
View file @
d32b06e5
/******************************************************************************
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* A pool of forked processes
*
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#pragma once
#include
<vector>
#include
"castor/server/BaseThreadPool.hpp"
#include
"castor/server/IThread.hpp"
#include
"castor/io/PipeSocket.hpp"
#include
"castor/exception/Exception.hpp"
namespace
castor
{
namespace
server
{
/**
* CASTOR thread pool based on the fork() syscall
* and using pipes for inter-process communication
*/
class
ForkedProcessPool
:
public
BaseThreadPool
{
public:
/**
* constructor
*/
ForkedProcessPool
(
const
std
::
string
poolName
,
castor
::
server
::
IThread
*
thread
)
;
/*
* destructor
*/
virtual
~
ForkedProcessPool
()
throw
();
/**
* Creates the pool by forking children processes.
* The parent process returns, children processes call childRun.
*/
virtual
void
init
()
;
/**
* Shutdowns the pool. Kills all children.
*/
virtual
bool
shutdown
(
bool
wait
)
throw
();
/**
* Runs the pool. The forking phase is done in init, thus this
* method is almost empty.
*/
virtual
void
run
()
;
/**
* Entry point to dispatch a task to an idle process
* @throw exception in case either select() or the transmission
* through the pipe fails.
*/
void
dispatch
(
castor
::
IObject
&
obj
)
;
protected:
/**
* The main loop of the children processes. This method is supposed
* to run forever or until the pipe is not broken.
*/
virtual
void
childRun
(
castor
::
io
::
PipeSocket
*
ps
);
/// The vector of PipeSockets to communicate to the children processes
std
::
vector
<
castor
::
io
::
PipeSocket
*>
m_childPipe
;
/// The process id of the child processes
int
*
m_childPid
;
/// The set of pipes to the children for writing, to be used with select
fd_set
m_writePipes
;
/// The highest numbered writing file descriptor
int
m_writeHighFd
;
};
}
// end of namespace server
}
// end of namespace castor
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