Re: about locks and condition variables

2017-10-11 Thread mikra
@rayman22201 for my very specific case (softtimerpool) the tickthread needs to sleep (after doing the counting-,signalling- and api-handling-stuff) to obtain the user-defined timebase for the artificial ticks and I donĀ“t like a thread for each counter (that would be resource-burning . My

Re: about locks and condition variables

2017-10-11 Thread mashingan
@mikra, are you not considering [asyncdispatch](https://nim-lang.org/docs/asyncdispatch.html) module?

Re: about locks and condition variables

2017-10-11 Thread rayman22201
Glad I could help. I don't want to disrespect your solution! You have basically implemented a spin lock, which is very high performance. As long as you can afford to burn cpu cycles on the wait loop inside the worker, it is a good solution. Like all important engineering problems, it is a

Re: How to use ropes module efficiently?

2017-10-11 Thread boia01
Is my understanding correct that both `string` and `Rope` have O(1) appends? I think `string` has amortized O(1) due to growing buffer space, whereas `Rope` has straight-up O(1) runtime complexity. But what might matter more here is the constant factor, and I think `string` ends up doing much

Re: noob confusion stream of conciousness

2017-10-11 Thread Tiberium
About toString - in Nim $ is used as a stringify operator for almost all types anywhere (not only in stdlib). So firstly try $ on a type

noob confusion stream of conciousness

2017-10-11 Thread bkerin
Enjoying the heck out of nim so far. In case it's useful for documentation or anything... So I want to use db, but it seems db_sqlite doesn't really offer prepared statements (though it uses them internally), so I dip down into sqlite3. A few hours for total noob to have prepared statement