Similar Threads:
1.Queues and multithreading
Yes you will. The queue is itself the problem and the reference
variable is just a layer away from the same problem. A global critical
section will work and is not overwhelmingly difficult it just takes a
lot of hand code to encapsulate the logic you need to access the
queue.
On 3 May 2010 06:37:32 -0400, "Vadim Berman"
<vadim.bermanATATATdigitalsonata.com> wrote:
>I guess there's no workaround, I'll have to control the access to the queue
>with the multithreading torture tools.
---------------------------------------
Paul Blais - Hayes, Virginia
2.intro, intermediate concurrent programming / multithreading
I know everybody in group has had to go through this transition at one
point, becoming more comfortable with concurrent programming.
I've seen the basics, am familiar a bit with facilities in mzscheme.
i'm currently using sisc for a project. i've read sicp in the past and
its discussions of mutex's, state.
just looking for one or two high quality recommendations for textbooks
or technical books on the subject. more from a perspective of good
techniques and general ideas. doesn't have to use scheme, but
preferred. need it to cover multiple approaches, can't only cover one
approach.
Checked some faq's, searched this group already, surprising didn't
find anything
my best guesses are the declarative concurrency, streams, and stateful
concurrency chapters in Concepts, Techniques, Models.... or one of the
books on concurrent ml or erlang.
appreciate it
3.Question about SRFI 18: Multithreading support
What is the motivation for having all threads terminate when the
primordial thread terminates? This seems like an arbitrary restriction.
Thanks,
Michael.
4.streams & multithreading & memoization
Hello schemers,
I'm interested in sharing SRFI-40 streams across (SRFI-18) threads.
The data I'm streaming is generated by external programs, and I would
like it to run semi-asynchronously with my scheme program.
The problem: if I do something like
(define (gen-stream src)
(stream-delay (stream-cons (get-next-value src) (gen-stream src)))
) )
and I'm sharing the stream across N threads which are *simultaneously*
doing
(stream-car <stream>) (e.g. if (get-next-value src) is blocking), then,
although
everyone will receive the same elements (memoization), N-1 elements
will be missed (ignored) by the stream-delay.
Now I suppose I could change the stream accessors to use mutex's and
only let one thread have access at a time -- that is, only let one
thread force the stream-delay at a time.
But does anyone have better ideas?
One thing I've tried is collecting continuations from everyone who
accesses a blocked stream, calling them in succession when I get a new
value to stream. But I'd rather use threads..
Another thing I considered was doing something like:
(define (get-element id)
(if (already-got? id) (element-ref id)
(begin
(get-next!)
(get-element id) ) ) )
(define (get-stream id)
(stream-delay (stream-cons (get-element id) (get-stream (+ id 1)))
) )
where (get-next!) blocks until a mutex signals a new result may be
accessible
via (element-ref <index>).
But then I have to save the entire stream, since I never know when the
memoization is complete.
So I'd have to...
(define (get-element id)
(if (already-got? id)
(if (already-memoized? id) #f (element-ref id))
(begin
(get-next!)
(get-element id) ) ) )
(define (get-stream id)
(stream-delay (stream-cons (get-element id) (get-stream (+ id 1)))
) )
(define (real-stream id)
(stream-delay
(let ([s (stream-force (get-stream id))])
(set-already-memoized?! id #t)
s) ) )
Which would allow me to release the values once they were memoized.
Isn't there an easier way?
Maybe I've just been thinking about it too much. :)
thanks,
Daniel Faken
5.question about tasks, multithreading and multi-cpu machines
In Ada it is possible to declare multiple parallel running "tasks". But for
my opinion the keyword "task" is somewhat misleding because in fact, those
"tasks" are really threads.
If I run such a program on a multi-cpu machine, the process itself will use
only one cpu, even though I create several "tasks".
I tested this with gnat v3.15p under HPUX 11 on a multi-cpu server.
How can I write my code to utilize all cpu's on such a machine? Is there a
different way in Ada to perform multi-tasking instead of multi-threading?
Thank you for your help!
Best regards, Norbert
6. multicore-multithreading benchmarks
7. multicdore-multithreading benchmarks
8. [Fwd: Free book: Multithreading]