articles filed under concurrency
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.
newLISP to get Cilk-style concurrency
posted on 04/03/08 at 1:12 p.m. |
|
Multi-processing in newLISP can be a chore. All processes must be directly known to any others that will be accessing shared memory, which must be synchronized using semaphores. A new development release of newLISP (9.3.7) will change all that by adding Cilk-style primitives.
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.