articles filed under threads

Locking with semaphores in newLISP
posted on 06/04/08 at 2:46 p.m. | |

Recent development version of newLISP have a new forking mechanism that makes spawning new processes and collecting the results much simpler.

However, for long-running processes that intermittently access shared data (for example, using the (share) function), semaphores are used to lock that data.

Threading in Django
posted on 03/07/08 at 10:46 a.m. | |

Profitable use of threading in web development is rare, particularly when contending with Python's global interpreter lock. There are a few notable exceptions to this.

Multi-threading in Python
posted on 11/30/07 at 10:02 a.m. | |

Programming with threads is one of the more difficult tasks in programming. The Python threading and Queue modules make this significantly easier, but it still takes some deliberation to use threads in an efficient way.

Python's thread and threading libraries use POSIX threads. The threading library is the higher level of the two and is therefore the one to use in your typical programming tasks. The Queue module provides a thread-safe mechanism for communicating between threads, like a combination list and semaphore.

Concurrency in newLISP
posted on 09/18/07 at 9:25 a.m. | |

Threaded applications are considered to be so difficult to implement properly that programmers are often encouraged to avoid them unless absolutely necessary. This is because of the difficulty in synchronizing data between threads. There are several techniques to accomplish this.