Re: [osg-users] Stack of actions todo

2008-05-15 Thread Alberto Luaces
El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
 Hi all,

 After a look on the net and in the archive, I think nobody did it before,
 but I prefer ask to earn time :

 I need to do something like a stack or a list of actions to apply on the
 scenegraph (FIFO stack if possible). I've a thread which will create the
 actions to make, and I need to do theses actions on the render loop,
 stopping the thread during the flush of the stack.

 Do OSG implement something like this ?

 Thanks,

 Regards,
    Vincent.

Hi Vicent,

how would it be different from an update callback?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Vincent Bourdier
Hi Alberto

I just need to control when I flush the stack, to synchonise with the
threads. A Callback would flush the stack (and so modify the graph) at the
same time of the callbacks which traverse the graph... It is dangerous.

I would stop the threads, flush my stack, and notify the threads to
continue...

2008/5/15 Alberto Luaces [EMAIL PROTECTED]:

 El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
  Hi all,
 
  After a look on the net and in the archive, I think nobody did it before,
  but I prefer ask to earn time :
 
  I need to do something like a stack or a list of actions to apply on the
  scenegraph (FIFO stack if possible). I've a thread which will create the
  actions to make, and I need to do theses actions on the render loop,
  stopping the thread during the flush of the stack.
 
  Do OSG implement something like this ?
 
  Thanks,
 
  Regards,
 Vincent.

 Hi Vicent,

 how would it be different from an update callback?
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Vincent Bourdier
Hi Robert,

You said then you'll need to place a barrier in frame loop to half the
frame loop thread

I'm not sure to understand how I can do it, and what do you mean by half
the frame loop ??

Moreover, I need a stack, that will be re-used for an other way, so I think
I'll keep this idea. I suppose the STL is the best way to do it and OSG not
implement something more useful for my problem.

Thanks,

Regards,
Vincent.

2008/5/15 Robert Osfield [EMAIL PROTECTED]:

 Hi Vincent,

 The OSG designed around the model of single threaded update,
 multi-thread cull-draw.  If you have others threads beyond the main
 frame loop thread that is want to do updates then you'll need to place
 a barrier in frame loop to half the frame loop thread while you
 operations run, then release the barrier when you operations are
 complete for that frame.

 Robert.

 On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  Hi Alberto
 
  I just need to control when I flush the stack, to synchonise with the
  threads. A Callback would flush the stack (and so modify the graph) at
 the
  same time of the callbacks which traverse the graph... It is dangerous.
 
  I would stop the threads, flush my stack, and notify the threads to
  continue...
 
  2008/5/15 Alberto Luaces [EMAIL PROTECTED]:
 
  El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
   Hi all,
  
   After a look on the net and in the archive, I think nobody did it
   before,
   but I prefer ask to earn time :
  
   I need to do something like a stack or a list of actions to apply on
 the
   scenegraph (FIFO stack if possible). I've a thread which will create
 the
   actions to make, and I need to do theses actions on the render loop,
   stopping the thread during the flush of the stack.
  
   Do OSG implement something like this ?
  
   Thanks,
  
   Regards,
  Vincent.
 
  Hi Vicent,
 
  how would it be different from an update callback?
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Robert Osfield
Hi Vincent,

How much threading have you done before, i.e. how confident are you
about using threads, blocks and barriers?  I asks this as I doubt no
how much to assume.

Robert.

On Thu, May 15, 2008 at 11:25 AM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 Hi Robert,

 You said then you'll need to place a barrier in frame loop to half the
 frame loop thread

 I'm not sure to understand how I can do it, and what do you mean by half
 the frame loop ??

 Moreover, I need a stack, that will be re-used for an other way, so I think
 I'll keep this idea. I suppose the STL is the best way to do it and OSG not
 implement something more useful for my problem.

 Thanks,

 Regards,
 Vincent.

 2008/5/15 Robert Osfield [EMAIL PROTECTED]:

 Hi Vincent,

 The OSG designed around the model of single threaded update,
 multi-thread cull-draw.  If you have others threads beyond the main
 frame loop thread that is want to do updates then you'll need to place
 a barrier in frame loop to half the frame loop thread while you
 operations run, then release the barrier when you operations are
 complete for that frame.

 Robert.

 On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  Hi Alberto
 
  I just need to control when I flush the stack, to synchonise with the
  threads. A Callback would flush the stack (and so modify the graph) at
  the
  same time of the callbacks which traverse the graph... It is dangerous.
 
  I would stop the threads, flush my stack, and notify the threads to
  continue...
 
  2008/5/15 Alberto Luaces [EMAIL PROTECTED]:
 
  El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
   Hi all,
  
   After a look on the net and in the archive, I think nobody did it
   before,
   but I prefer ask to earn time :
  
   I need to do something like a stack or a list of actions to apply on
   the
   scenegraph (FIFO stack if possible). I've a thread which will create
   the
   actions to make, and I need to do theses actions on the render loop,
   stopping the thread during the flush of the stack.
  
   Do OSG implement something like this ?
  
   Thanks,
  
   Regards,
  Vincent.
 
  Hi Vicent,
 
  how would it be different from an update callback?
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Vincent Bourdier
I'm not very familiar with threads, and no more with OpenThreads... but I
learn quickly if I understand.

But if I need to spend a week to understant and set it, I'd better make my
stack I think...

Vincent

2008/5/15 Robert Osfield [EMAIL PROTECTED]:

 Hi Vincent,

 How much threading have you done before, i.e. how confident are you
 about using threads, blocks and barriers?  I asks this as I doubt no
 how much to assume.

 Robert.

 On Thu, May 15, 2008 at 11:25 AM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  Hi Robert,
 
  You said then you'll need to place a barrier in frame loop to half the
  frame loop thread
 
  I'm not sure to understand how I can do it, and what do you mean by half
  the frame loop ??
 
  Moreover, I need a stack, that will be re-used for an other way, so I
 think
  I'll keep this idea. I suppose the STL is the best way to do it and OSG
 not
  implement something more useful for my problem.
 
  Thanks,
 
  Regards,
  Vincent.
 
  2008/5/15 Robert Osfield [EMAIL PROTECTED]:
 
  Hi Vincent,
 
  The OSG designed around the model of single threaded update,
  multi-thread cull-draw.  If you have others threads beyond the main
  frame loop thread that is want to do updates then you'll need to place
  a barrier in frame loop to half the frame loop thread while you
  operations run, then release the barrier when you operations are
  complete for that frame.
 
  Robert.
 
  On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier
  [EMAIL PROTECTED] wrote:
   Hi Alberto
  
   I just need to control when I flush the stack, to synchonise with
 the
   threads. A Callback would flush the stack (and so modify the graph) at
   the
   same time of the callbacks which traverse the graph... It is
 dangerous.
  
   I would stop the threads, flush my stack, and notify the threads to
   continue...
  
   2008/5/15 Alberto Luaces [EMAIL PROTECTED]:
  
   El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
Hi all,
   
After a look on the net and in the archive, I think nobody did it
before,
but I prefer ask to earn time :
   
I need to do something like a stack or a list of actions to apply
 on
the
scenegraph (FIFO stack if possible). I've a thread which will
 create
the
actions to make, and I need to do theses actions on the render
 loop,
stopping the thread during the flush of the stack.
   
Do OSG implement something like this ?
   
Thanks,
   
Regards,
   Vincent.
  
   Hi Vicent,
  
   how would it be different from an update callback?
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Robert Osfield
Hi Vincent,

The OSG designed around the model of single threaded update,
multi-thread cull-draw.  If you have others threads beyond the main
frame loop thread that is want to do updates then you'll need to place
a barrier in frame loop to half the frame loop thread while you
operations run, then release the barrier when you operations are
complete for that frame.

Robert.

On Thu, May 15, 2008 at 10:39 AM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 Hi Alberto

 I just need to control when I flush the stack, to synchonise with the
 threads. A Callback would flush the stack (and so modify the graph) at the
 same time of the callbacks which traverse the graph... It is dangerous.

 I would stop the threads, flush my stack, and notify the threads to
 continue...

 2008/5/15 Alberto Luaces [EMAIL PROTECTED]:

 El Jueves 15 Mayo 2008ES 11:00:41 Vincent Bourdier escribió:
  Hi all,
 
  After a look on the net and in the archive, I think nobody did it
  before,
  but I prefer ask to earn time :
 
  I need to do something like a stack or a list of actions to apply on the
  scenegraph (FIFO stack if possible). I've a thread which will create the
  actions to make, and I need to do theses actions on the render loop,
  stopping the thread during the flush of the stack.
 
  Do OSG implement something like this ?
 
  Thanks,
 
  Regards,
 Vincent.

 Hi Vicent,

 how would it be different from an update callback?
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Robert Osfield
On Thu, May 15, 2008 at 11:43 AM, Vincent Bourdier
[EMAIL PROTECTED] wrote:
 I'm not very familiar with threads, and no more with OpenThreads... but I
 learn quickly if I understand.

 But if I need to spend a week to understant and set it, I'd better make my
 stack I think...

Have a read through docs on pthreads as OpenThreads is maps pthreads
functionality quite well, basically providing a C++ wrapper for the
underlying thread implementation and a few help classes on top.

The core OSG has a few further higher level help classes like
osg::Operation and osg::OperationThread that you could use.

A basic grounding with threading in general will help you understand
the issues.  Also do searches through the OSG itself to see how it
uses various OpenThreads classes.

Don't expect threading to come easy though, it's can be a hard topic
the first time you start working on it, so invest the time now you'll
benefit from this for the rest of your career.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Stack of actions todo

2008-05-15 Thread Vincent Bourdier
Thanks for your help,
I'll try to look at it in details.

Regards,
   Vincent.

2008/5/15 Robert Osfield [EMAIL PROTECTED]:

 On Thu, May 15, 2008 at 11:43 AM, Vincent Bourdier
 [EMAIL PROTECTED] wrote:
  I'm not very familiar with threads, and no more with OpenThreads... but I
  learn quickly if I understand.
 
  But if I need to spend a week to understant and set it, I'd better make
 my
  stack I think...

 Have a read through docs on pthreads as OpenThreads is maps pthreads
 functionality quite well, basically providing a C++ wrapper for the
 underlying thread implementation and a few help classes on top.

 The core OSG has a few further higher level help classes like
 osg::Operation and osg::OperationThread that you could use.

 A basic grounding with threading in general will help you understand
 the issues.  Also do searches through the OSG itself to see how it
 uses various OpenThreads classes.

 Don't expect threading to come easy though, it's can be a hard topic
 the first time you start working on it, so invest the time now you'll
 benefit from this for the rest of your career.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org