On Jul 17, 2008, at 22:51 , Glen Gibb wrote:
> I need to periodically perform an action that is likely to take some
> time. I'm concerned about the performance impact on NOX if my
> application is off doing something for a while -- is it likely to
> block
> all packet processing?
It'll block the packet processing, if you don't create a new native
thread for your blocking action. This is because the NOX threading
model is cooperative, and by default there's only a single active NOX
thread at any given time. The platform makes one of the threads then
made responsible for processing of events and timers, but this
allocation changes over the time.
> I'd potentially like to run my task in a separate thread -- is there
> an
> easy way to do this in NOX?
I presume you need some interaction between your native thread and the
NOX cooperative threads. This basically translates into
synchronization requirements between native threads. For that, I'd
suggest to take a loot at the classes in nox/include/thread/
{native.hh,native-pool.hh}. They are designed exactly this kind of
situation in mind. Especially the pool could be very close to your
requirements.
HTH,
Teemu
--
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org