lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

A little more here
And then the reference manual (now ieee standard), which can be
downloaded with library. Event expressions are limited. I don't know
whatyou're your expectations here. But being a hardware definition
language like, it supports better static or list for processes (it
distinguished between sc_method vhdl like process sensitive to signal
changes or events) and sc_thread (stackful and thus supporting sc_wait)
. It is possible to create and list too. And it can not be combined with
or list to make complex expression. 
Internally this event queue is the same as the lua algo given in the
thread. So log(n) push and pop.
I use it at work, and have written an equivalent in a previous company
few years ago. I think it could be more efficient, but it is already
quite ok for your needs I think. And easy to abstract the few keep
concept you need in a small lua API, so that you may design you system
in lua above the systemc kernel.

-----Original Message-----
[] On Behalf Of Geoff Leyland
Sent: Friday, July 27, 2007 12:02 AM
To: Lua list
Subject: Re: Priority Queues?

Thanks Thierry,

I hadn't seen SystemC before, and since I know nothing about VHDL, I  
wouldn't have known to look for it.  Haven't found the docs that  
point to the underlying DE framework, but it's pretty clear that it's  
there.  I'm guessing you have experience with SystemC and like it?

It still leaves the original "problem" which I think boils down to  
"what's a good way keep track of a lot of lua objects in C/C++?", to  
which which one solution seems to be keep them in a table in the  
registry refer to them by indexes into that table.

(Incidentally, Jerome, I apologise for being dense before.  Your idea  
about the lightuserdata makes perfect sense now: I can almost  
certainly find a pointer somewhere to pair with each lua object and  
use as a lightuserdata key in the table)

On the offchance anyone's interested, in a fit of motivation I wrote  
a little DE engine in Lua last night.  It's really not much, but it  
came together in no time at all and it's already shown me a few new  
(to me at least) ways to think about things.  Lua makes programming  
fun again!


On 27/07/2007, at 12:07 AM, Grellier, Thierry wrote:

> Maybe off topic, but SystemC ( can be used as a  
> discrete
> event simulation system, and maybe provide all you need although it is
> pure c++, and you already have a simulation engine. You then just have
> to make a lua callback for the "threads" of your simulation with only
> wrapping the event API, and thread creation, but won't have to  
> maintain
> a simulation kernel.