Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Lua module U114
Threading and Coroutines.
Exercises, examples and other material relating to training module U114. This topic is presented on public courses Learning to program in Lua, Lua Programming




Articles and tips on this subjectupdated
4270Embedding Lua to perform tailored code at an interval
Lua is a language that's commonly embedded within other products - a game, or a control system, for example - in order to provide a programmable tailoring of that other product. It's a great language for that - it's small, it's free, it has a suitable open source license, and it comes as a C library ...
2014-05-03
 
3395Parallel but not really parallel. Moving game characters. Coroutines in Lua.
Virtual World game programming involves moving many characters - both player controlled and automatic - in parallel. The movements of each character depend - to a greater or lesser extent - on the prior movements of the character, and of the other charcaters and the resultant position and condition that ...
2011-08-18
 
2455Lua examples - coroutines, error handling, objects, etc
I have presented a bespoke Lua course over the last three days ... and it has lead me to some interesting new examples which I'm sharing here. Object Orientation is more a way of thinking and coding than a language feature in Lua - when you set up a piece of data / structure / object, you do so in a ...
2009-10-17
 
2314Passing parameters to a coroutine in Lua
Lua's coroutines, like Python's generators, provide for something which is akin to lightweight threading - rather than a strict functional calling stack, where one function must be completed before another is invoked, you can call a code block (function or method) and have it yield back to the calling ...
2009-08-01
 
1870What to do with a huge crop of apples
Last year, you had a good crop of apples on your tree .... what did you do with them? Make apple pies for all the neighbours! How? • You collect all the apples and bring them into the kitchen. • You prepare the apples ready for the pies. • You make the pastry and apple pies. • You ...
2008-11-04
 
1699If you are learning Lua, here are some more examples
During some courses, I write few (if any) new examples in front of my delegates, rather relying on the standard ones in the training notes (which I wrote anyway!) and making small changes and adjustments to illustrate how things work. On other courses, though, I write a some new examples from scratch ...
2008-08-05
 
1691Co-routines in Lua - co-operative processing
CoRoutines in Lua allow you to have a number of pieces of co-operative code which (whilst they’re not running in parallel in a true multithreaded way) allow you to progress through multiple strands of your code at the sametime. Let’s take an example. I have a rather large text file that lists ...
2008-06-29
 
Examples from our training material
charmoves   coroutine for game player movements
controller   setting off a number of timers
coro   simple coroutine example
cosy   Illustration of Coroutines
crcr   coroutine basics
datafeeder   using a coroutine as a generator
ff2.lua   Multiple coroutines in parallel use
inco   Passing parameters to coroutines
nocoro   NOT using coroutines - filling a table then using it instead
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
Coroutines as co-operative programs.
Transferring control and maintaining state.
Concurrent tasks, and keeping them apart.
Event handling - event loops and yielding
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/U114.html • PAGE BUILT: Wed Mar 6 10:39:20 2013 • BUILD SYSTEM: wizard