lua-users home
lua-l archive

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


Hi,

I'm currently going through the Programming in Lua (PIL) book, and have found problems in running the examples in chapter9.4 'Non Preemptive multithreading'.

When I run the download example which does'nt use coroutines, it works fine.
( it downloads, but occasionally I get a memory exception saying memory could
not be read)
http://uk.geocities.com/mswinson@btinternet.com/tmp/lua/download.txt

When I try the non-preemptive coroutine example, it seems to go into the
'download' coroutine, then back to the dispatcher and remains in the dispatcher
without resuming any of the other threads.

The code as I've typed it in is at:
http://uk.geocities.com/mswinson@btinternet.com/tmp/lua/download2.txt

I'm using Lua 5.0.2 and LuaSocket   2.0 (beta 3) with compat5.1.lua

Has anyone else experienced similar problems.

Mark