Monday, August 11, 2008

ojos de buho

Bah, no puedo dormir y es mi culpa.

No, no es porque dormí en la tarde. Es por tomar Excedrin para el dolor de cabeza. Lo he estado probando desde hace unos pocos días y me resulta mejor que la aspirina a la que estoy acostumbrado; pero soy demasiado sensible a la cafeína. En general eso es bueno, así me basta con tomar un vaso o dos de cocacola y me hace efecto para trabajar de noche, o simplemente para ayudar a concentrarme.

Pero hoy quería dormir. Mañana seguro estaré cansado de nuevo.

bah.

Wednesday, June 18, 2008

compiles? ship it!

OK, the lock-free hash table for Lua is working! after a little cleanup of the code, i announced it on the Lua list. Let's hope it stirs some new ideas. interested? get it here!

The code is small, so reading it all and comprehending isn't so hard... the next step should be writing some real tests to see if it really works. Bracing for embarrassment...

Thursday, May 29, 2008

Lock-free concurrent Lua?

For some time now I've been thinking about how to make Lua concurrent. That is, having several threads of execution, all in the same Lua space, sharing all data; but without the Big Language Lock that effectively sequentializes execution of most of the code.

Of course, the problem is that LuaThreads (the only Lua multithreading extension that puts all threads on the same space) uses just one lock per space, and all threads fight for this one resource.

One 'obvious' solution would be to use one lock per object. A little better might be to use readers/writers locks, to allow concurrent readings. yep, should work.

But a couple of days ago I saw this: Scalable Nonblocking Data Structures on Slashdot about a guy that got lock-free hashtables with great scalability on 700+ threads (with even more cores than threads!). The article was very simplistic, and seemingly inconsistent; but one /.er pointed to the Google Talk. Now that's inspiring!

I've previously read about lock-free algorithms and data structures, but this guy (that turned to be the Cliff Click)

So, after a couple of days of mulling about it, I'm hacking some code!

The original idea was to see if it's possible to lock-free'ize Lua tables. It's no easy task. The main stumbling block is that it seems that the CAS primitives available in gcc operate on pointer-sized values; since Lua tables store values directly in the hash table (and specially on the array part of the table), it's important to swap values atomically.

Much easier, and what I'm doing now, is to write new table code, lock-free from the start.

Of course, I'm using lots of naïve code in several parts, but hope to get the main ideas set, and clean silly things later (initialization right now looks very slow). Also, I still have no idea how to do the array part, and there are some unresolved issues on table resizing; but they all seem doable. And the code is coming surprisingly clean.

:-)

Wednesday, April 16, 2008

LaTeX

Si, hace años que sabía de la existencia de TeX y LaTeX, pero no veía ninguna motivación para aprender. Ahora apareció: resulta que si usas pdfTeX (y/o pdfLaTeX), el file de contenido puede jalar cualquier página de un PDF para usarla como imágen. Sumando a esto el lenguaje de layout de TeX, ya son todos los elementos para hacer una imposición PDF->PDF!

Así que estoy en eso. Aún atascado en cómo agregar fonts, pero supuestamente puedo usar Type1, así que debe haber alguna forma.

Wednesday, April 2, 2008

mudanza

ya fue!

ahora estamos en la nueva casita, llena de cajas. muy felices y mucho trabajo por hacer.

Thursday, March 6, 2008

bioortesis.com

Carmen y Cecilia se están poniendo las pilas para su trabajo juntas, por lo pronto hicieron nuevas tarjetas para repartir a todos lados. Por supuesto, ahora había que poner una página web, asi que registramos www.bioortesis.com y lo armamos con GoogleSites. Ahora tienen su correo nuevo, espacio para documentos, etc. mostro.