[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6975 - in gnuradio/branches/developers/eb/gcell/src:
From: |
eb |
Subject: |
[Commit-gnuradio] r6975 - in gnuradio/branches/developers/eb/gcell/src: include lib |
Date: |
Fri, 16 Nov 2007 18:29:58 -0700 (MST) |
Author: eb
Date: 2007-11-16 18:29:57 -0700 (Fri, 16 Nov 2007)
New Revision: 6975
Added:
gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager_impl.h
gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
Modified:
gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am
gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
Log:
work-in-progress on cell job manager
Modified: gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
2007-11-17 01:08:56 UTC (rev 6974)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager.h
2007-11-17 01:29:57 UTC (rev 6975)
@@ -22,6 +22,7 @@
#ifndef INCLUDED_GC_JOB_MANAGER_H
#define INCLUDED_GC_JOB_MANAGER_H
+#include <boost/utility.hpp>
#include "gc_job_desc.h"
class gc_job_manager;
@@ -40,15 +41,15 @@
* There is typically a single instance derived from this class.
* It is safe to call its methods from any thread.
*/
-class gc_job_manager
+class gc_job_manager : boost::noncopyable
{
public:
/*!
* \param nspes number of SPEs job manager should use.
* If nspes == -1, all available SPEs will be allocated.
*/
- */
gc_job_manager(int nspes = -1);
+
virtual ~gc_job_manager();
/*!
Added: gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager_impl.h
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager_impl.h
(rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager_impl.h
2007-11-17 01:29:57 UTC (rev 6975)
@@ -0,0 +1,123 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio 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 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef INCLUDED_GC_JOB_MANAGER_IMPL_H
+#define INCLUDED_GC_JOB_MANAGER_IMPL_H
+
+#include "gc_job_manager.h"
+
+
+class gc_job_manager_impl;
+
+/*!
+ * \brief Concrete class that manages SPE jobs.
+ *
+ * This class contains all the implementation details.
+ */
+
+class gc_job_manager_impl : public gc_job_manager
+{
+ friend gc_job_manager *gc_make_job_manager(int nspes);
+
+ /*!
+ * \param nspes number of SPEs job manager should use.
+ * If nspes == -1, all available SPEs will be allocated.
+ */
+ gc_job_manager_impl(int nspes = -1);
+
+public:
+ virtual ~gc_job_manager_impl();
+
+ /*!
+ * Stop accepting new jobs. Wait for existing jobs to complete.
+ * Return all managed SPE's to the system.
+ */
+ virtual bool shutdown();
+
+ /*!
+ * \brief Return number of SPE's currently allocated to job manager.
+ */
+ virtual int nspes() const;
+
+ /*!
+ * \brief Set the number of spes allocated to the job manager to \p nspes.
+ *
+ * \param nspes number of SPEs job manager should use.
+ *
+ * If nspes == -1, all available SPEs will be allocated.
+ * This method blocks until the number of managed spes has been adjusted.
+ */
+ virtual bool set_nspes(int nspes);
+
+ /*!
+ * \brief Return a pointer to a properly aligned job descriptor.
+ * Throws if none are available.
+ */
+ virtual gc_job_desc *alloc_job_desc();
+
+ /*
+ *! Return a job descriptor previously allocated with alloc_job_desc()
+ *
+ * \param[in] jd pointer to job descriptor to free.
+ */
+ virtual void free_job_desc(gc_job_desc *jd);
+
+ /*!
+ * \brief Submit a job for asynchronous processing on an SPE.
+ *
+ * \param[in] jd pointer to job description
+ *
+ * The caller must not read or write the job description
+ * or any of the memory associated with any indirect arguments
+ * until after a successful call to wait_*.
+ *
+ * \returns true iff the job was successfully enqueued.
+ * If submit_job returns false, check jd->status for additional info.
+ */
+ virtual bool submit_job(gc_job_desc *jd);
+
+ /*!
+ * \brief Wait for specified job to complete.
+ */
+ virtual bool wait_job(gc_job_desc *jd);
+
+#if 0
+ /*!
+ * \brief Wait for any job to complete.
+ * \param[in] jobs vector of jobs
+ *
+ * FIXME need to return info about which jobs completed.
+ */
+ int wait_any_jobs(const std::vector<gc_job_desc *> &jobs);
+
+ /*!
+ * \brief Wait for alls jobs to complete.
+ * \param[in] jobs vector of jobs
+ *
+ * FIXME need to return info about which jobs completed.
+ */
+ int wait_all_jobs(const std::vector<gc_job_desc *> &jobs);
+#endif
+
+};
+
+
+#endif /* INCLUDED_GC_JOB_MANAGER_IMPL_H */
Property changes on:
gnuradio/branches/developers/eb/gcell/src/include/gc_job_manager_impl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am 2007-11-17
01:08:56 UTC (rev 6974)
+++ gnuradio/branches/developers/eb/gcell/src/lib/Makefile.am 2007-11-17
01:29:57 UTC (rev 6975)
@@ -27,5 +27,7 @@
lib_LTLIBRARIES = libgcell.la
libgcell_la_SOURCES = \
- gc_job_manager.cc
+ gc_job_manager.cc \
+ gc_job_manager_impl.cc
+
Modified: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
2007-11-17 01:08:56 UTC (rev 6974)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager.cc
2007-11-17 01:29:57 UTC (rev 6975)
@@ -24,7 +24,7 @@
#endif
#include "gc_job_manager.h"
-gc_job_manager::gc_job_manager()
+gc_job_manager::gc_job_manager(int nspes)
{
// nop
}
Added: gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
===================================================================
--- gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
(rev 0)
+++ gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
2007-11-17 01:29:57 UTC (rev 6975)
@@ -0,0 +1,77 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio 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 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "gc_job_manager_impl.h"
+
+
+gc_job_manager_impl::gc_job_manager_impl(int nspes)
+{
+}
+
+gc_job_manager_impl::~gc_job_manager_impl()
+{
+}
+
+bool
+gc_job_manager_impl::shutdown()
+{
+ return false; // FIXME
+}
+
+int
+gc_job_manager_impl::nspes() const
+{
+ return 0; // FIXME
+}
+
+bool
+gc_job_manager_impl::set_nspes(int nspes)
+{
+ return false; // FIXME
+}
+
+gc_job_desc *
+gc_job_manager_impl::alloc_job_desc()
+{
+ return 0;
+}
+
+void
+gc_job_manager_impl::free_job_desc(gc_job_desc *jd)
+{
+ // FIXME
+}
+
+bool
+gc_job_manager_impl::submit_job(gc_job_desc *jd)
+{
+ return false; // FIXME
+}
+
+bool
+gc_job_manager_impl::wait_job(gc_job_desc *jd)
+{
+ return false; // FIXME
+}
+
Property changes on:
gnuradio/branches/developers/eb/gcell/src/lib/gc_job_manager_impl.cc
___________________________________________________________________
Name: svn:eol-style
+ native
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6975 - in gnuradio/branches/developers/eb/gcell/src: include lib,
eb <=