http://groups.google.com/group/comp.programming.threads?hl=en
comp.programming.threads@googlegroups.com
Today's topics:
* some issue w.r.t. pthread_cond_signal( ) - 5 messages, 4 authors
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/a0280bc019886ffc?hl=en
* Examples of performance threading applications - 4 messages, 3 authors
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/5e4ab3806b9a2dd4?hl=en
* Memory leak in vm ? JDK1.6_0.6 - 1 messages, 1 author
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/db9fdec460f053d4?hl=en
* Announce: just::thread C++0x thread library beta 0.2 - 3 messages, 2 authors
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/81a1e1ff026042de?hl=en
* Lock-free ring buffer memory barriers test case - 1 messages, 1 author
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/e9e4e52260123236?hl=en
* Basic thread questions - 3 messages, 3 authors
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/cb9c47ec5e9e9e02?hl=en
==============================================================================
TOPIC: some issue w.r.t. pthread_cond_signal( )
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/a0280bc019886ffc?hl=en
==============================================================================
== 1 of 5 ==
Date: Tues, Oct 28 2008 11:58 pm
From: Szabolcs Ferenczi
On Oct 29, 1:06 am, David Schwartz <dav...@webmaster.com> wrote:
> Szabolcs Ferenczi wrote:
> > On Oct 27, 1:03 pm, Dave Butenhof <david.buten...@hp.com> wrote:
> > I hope I could help you to understand why you should not use the
> > phrase "shared data predicate" and why you should refrain yourself
> > attacking others with low language whenever you see the phrase
> > "semaphore".
>
> > If you need any further help, just ask.
>
> This is comedy gold. Thank you for brightening my day.
Well, it was not for you, was it?
You may try to follow it, although, you are hopeless, you cannot be
helped, I am afraid. You just jump as a monkey again, as usual.
Instead, you might try to understand the reasoning, though.
Best Regards,
Szabolcs
== 2 of 5 ==
Date: Wed, Oct 29 2008 2:04 pm
From: David Schwartz
On Oct 28, 11:58 pm, Szabolcs Ferenczi <szabolcs.feren...@gmail.com>
wrote:
> You may try to follow it, although, you are hopeless, you cannot be
> helped, I am afraid. You just jump as a monkey again, as usual.
> Instead, you might try to understand the reasoning, though.
I tried, but the soda coming out of my nose was too much of a
distraction.
DS
== 3 of 5 ==
Date: Wed, Oct 29 2008 2:28 pm
From: Szabolcs Ferenczi
On Oct 29, 10:04 pm, David Schwartz <dav...@webmaster.com> wrote:
> On Oct 28, 11:58 pm, Szabolcs Ferenczi <szabolcs.feren...@gmail.com>
> wrote:
>
> > You may try to follow it, although, you are hopeless, you cannot be
> > helped, I am afraid. You just jump as a monkey again, as usual.
> > Instead, you might try to understand the reasoning, though.
>
> I tried, but the soda coming out of my nose was too much of a
> distraction.
That is your problem, jumping monkey.
Best Regards,
Szabolcs
== 4 of 5 ==
Date: Wed, Oct 29 2008 3:41 pm
From: Dave Butenhof
Chris M. Thomasson wrote:
>
> I don't think that Szabolcs stupid; He just sure seems to sometimes act
> that way when he trolls!
You know, Chris, that's very generous of you. Every once in a while I
almost agree...
And then he posts another reply, and I'm not so sure anyone could do
quite so thorough and consistent a job of only pretending to be an
obnoxious jerk. Then again, perhaps I'm not giving him enough credit for
acting talent.
And he can't seem to say anything at all without blatantly irrelevant
personal attacks on anyone and everyone who disagrees with him, which
makes him extraordinarily unpleasant even when he does occasionally say
something that's at least technically worthwhile.
== 5 of 5 ==
Date: Wed, Oct 29 2008 9:38 pm
From: rani_sharoni@hotmail.com
> Best Regards,
> Szabolcs
I'm silently following this rivalry for a while and since I think that
you have good intentions, it seems unnecessary and actually armful for
the readers you want to assist. I think that some insignificant
disagreements went out of control and into bad dynamics when we should
all be at peace in this context of friendly debates.
I feel that I can speak of behalf of most of the readers in this
newsgroup that we are blessed with having Dave Butenhof regularly
posting. His insights and observations are simply priceless. Though I
hold great respect for the researchers that invented some of the
concepts that we debate about, when it comes to practical multi-
threaded programming, experts like Dave are the authority with years
of experience and influence.
Like me, you seem to be very opinionated and loyal to your beliefs,
but by being open minded for experts like Dave you actually have
opportunity to refine your believes and that will serve you well
growing as an expert.
For example, As a Microsoft employee I work solely in corners of
windows in which conditional variables were never heard of but still I
learn a lot from Dave's posts (and book) about multi-threaded
programming when he talks about conditional variables. I often see how
lack of such fundamental construct resulted with over complicated
solutions that are hard to reason about.
Please let's try to be more cooperative in our common quest to help
others.
Rani
==============================================================================
TOPIC: Examples of performance threading applications
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/5e4ab3806b9a2dd4?hl=en
==============================================================================
== 1 of 4 ==
Date: Wed, Oct 29 2008 2:47 am
From: zr
Hi,
I am staring to work on a new project and need to learn performance
multithreading. I tried to google for some open-source examples of
some performance multithreaded applications, but couldn't find much
other than ray tracers and the x264 codec. There are many toy kernels
used for research and benchmarking that show good scalability with
threads, but very few useful (to someone) applications. Is the open-
source software an exception to the entire software world or does also
commercial software lack performance threading?
I would like to hear from other people that develop in threads about
their work, and how successful they were in scaling their
applications.
== 2 of 4 ==
Date: Wed, Oct 29 2008 3:08 am
From: Ian Collins
zr wrote:
> Hi,
>
> I am staring to work on a new project and need to learn performance
> multithreading.
performance multithreading?
> I tried to google for some open-source examples of
> some performance multithreaded applications, but couldn't find much
> other than ray tracers and the x264 codec. There are many toy kernels
> used for research and benchmarking that show good scalability with
> threads, but very few useful (to someone) applications.
The OpenSolaris Kernel (scales to hundreds of cores)?
> Is the open-
> source software an exception to the entire software world or does also
> commercial software lack performance threading?
What is "performance threading"?
--
Ian Collins
== 3 of 4 ==
Date: Wed, Oct 29 2008 3:46 am
From: zr
On Oct 29, 12:08 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> zr wrote:
> > Hi,
>
> > I am staring to work on a new project and need to learn performance
> > multithreading.
>
> performance multithreading?
>
> > I tried to google for some open-source examples of
> > some performance multithreaded applications, but couldn't find much
> > other than ray tracers and the x264 codec. There are many toy kernels
> > used for research and benchmarking that show good scalability with
> > threads, but very few useful (to someone) applications.
>
> The OpenSolaris Kernel (scales to hundreds of cores)?
By "application", i meant a program that runs in user mode that has
input and output.
>
> > Is the open-
> > source software an exception to the entire software world or does also
> > commercial software lack performance threading?
>
> What is "performance threading"?
I don't know the exact definition of "performance threading", but what
i mean is threading your application in order to make it run faster
than it would have run were it running serially. It seems that most of
threaded apps are classified as "convenience threading" where threads
are most of the time sleeping or spinning while waiting for some some
event (which is usually triggered by I/O).
>
> --
> Ian Collins
== 4 of 4 ==
Date: Wed, Oct 29 2008 7:20 am
From: sean_in_raleigh@yahoo.com
On Oct 29, 5:47 am, zr <zvir...@gmail.com> wrote:
> Hi,
>
> I am staring to work on a new project and need to learn performance
> multithreading. I tried to google for some open-source examples of
> some performance multithreaded applications, but couldn't find much
> other than ray tracers and the x264 codec. There are many toy kernels
> used for research and benchmarking that show good scalability with
> threads, but very few useful (to someone) applications. Is the open-
> source software an exception to the entire software world or does also
> commercial software lack performance threading?
> I would like to hear from other people that develop in threads about
> their work, and how successful they were in scaling their
> applications.
Check out BOINC:
http://en.wikipedia.org/wiki/BOINC
or any of the other distributed computing projects,
which are likely to all do threading for parallelism
exploitation rather than I/O handling:
http://en.wikipedia.org/wiki/List_of_distributed_computing_projects
Sean
==============================================================================
TOPIC: Memory leak in vm ? JDK1.6_0.6
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/db9fdec460f053d4?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Oct 29 2008 3:04 am
From: Stefan
I wrote the reference implementation of the
com.sun.net.httpserver.HttpServer
It seems to be a memory leak in JVM or do i leave some resources
open.
Thankful if you have some suggestions!
mport java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
class Server implements HttpHandler
{
public void handle( HttpExchange httpExchange ) throws IOException
{
httpExchange.getResponseHeaders().add( "Content-type", "text/
html" );
String response = "test ";
httpExchange.sendResponseHeaders( 200, response.length() );
OutputStream os = httpExchange.getResponseBody();
os.write( response.getBytes() );
os.close(); //
}
public static void main(String[] args) {
HttpServer server = null;
try {
server = HttpServer.create( new InetSocketAddress( 80 ), 0 );
} catch(IOException e) {
}
server.createContext( "/", new Server() );
server.start();
}
}
==============================================================================
TOPIC: Announce: just::thread C++0x thread library beta 0.2
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/81a1e1ff026042de?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Oct 29 2008 3:53 am
From: Anthony Williams
"Dmitriy V'jukov" <dvyukov@gmail.com> writes:
> Anthony Williams:
>> Hi,
>>
>> I am pleased to announce the release of the 0.2 beta release of the
>> just::thread C++0x thread library from Just Software Solutions Ltd.
>>
>> The just::thread library is available from http://www.stdthread.co.uk
>> and provides an almost complete implementation of the thread library
>> from the C++0x working draft
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf.
>
> What is the purpose of this library? Is it intended that I will just
> replace "just::" with "std::" in future and throw away the library?
"just::thread" is just the name of the library. If you use it, you can
write "std::thread" in the code. It *is* an implementation of the
C++0x thread library. You will never need to "throw it away" unless
you use a compiler that isn't supported.
Anthony
--
Anthony Williams
Author of C++ Concurrency in Action | http://www.manning.com/williams
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK
== 2 of 3 ==
Date: Wed, Oct 29 2008 3:54 am
From: Anthony Williams
"Dmitriy V'jukov" <dvyukov@gmail.com> writes:
> On 24 окт, 15:46, Anthony Williams <anthony....@gmail.com> wrote:
>
>> The library currently only works with Microsoft Visual C++ 2008
>> (including the Express edition), but support for other compilers and
>> platforms is in the pipeline.
>
> I am curious, how are you going to implement memory_order_consume on
> platforms where acquire fence is not free?
Without compiler support, it will have to be an acquire fence.
Anthony
--
Anthony Williams
Author of C++ Concurrency in Action | http://www.manning.com/williams
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK
== 3 of 3 ==
Date: Wed, Oct 29 2008 10:59 pm
From: "Dmitriy V'jukov"
On 29 ÏËÔ, 13:54, Anthony Williams <anthony....@gmail.com> wrote:
> "Dmitriy V'jukov" <dvyu...@gmail.com> writes:
> > On 24 ÏËÔ, 15:46, Anthony Williams <anthony....@gmail.com> wrote:
>
> >> The library currently only works with Microsoft Visual C++ 2008
> >> (including the Express edition), but support for other compilers and
> >> platforms is in the pipeline.
>
> > I am curious, how are you going to implement memory_order_consume on
> > platforms where acquire fence is not free?
>
> Without compiler support, it will have to be an acquire fence.
What do you think about following implementation:
T load_consume(T const* a)
{
T v = *const_cast<T const volatile*>(a);
acquire_compiler_fence();
return v;
}
?
It can break stupid things like:
int x = load_consume(y);
int z = q[x - x];
But must work for *real* data-dependencies.
Dmitriy V'jukov
==============================================================================
TOPIC: Lock-free ring buffer memory barriers test case
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/e9e4e52260123236?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Oct 29 2008 4:15 am
From: Olivier Guilyardi
Hi,
Can any of you advise a good test case that would demonstrate memory
barriers are needed in a lock-free ring buffer ? I mean: a piece of
code that would fail because memory barriers are missing.
I wrote the following test, and it succeeds on PowerPC SMP (dual IBM
Cell system QS-20), which is supposed to have weak memory ordering:
http://svn.samalyse.com/misc/rbtest/test-int-array.c
It is part of a (4 implementations) ring buffer test suite, that one
can run with:
svn co http://svn.samalyse.com/misc/rbtest
cd rbtest
make test
Best regards,
--
Olivier Guilyardi / Samalyse
==============================================================================
TOPIC: Basic thread questions
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/cb9c47ec5e9e9e02?hl=en
==============================================================================
== 1 of 3 ==
Date: Wed, Oct 29 2008 9:41 am
From: Zerex71
Hi group,
I am writing a m/t application at work that basically deals with
several software-hardware interfaces. As one example, when the box
(Linux RHEL 5.1 in a ruggedized form factor) reads data from an RS-422
(serial) port from another box, it then converts the data into UDP
datagrams to be sent on to yet a third device. In my app, I have a
listener thread which pulls from the RS-422 card and interprets the
raw data coming in.
Now what I have discovered is in a test box which is driving my
RS-422, if I don't throttle the messaging, the test box (a PC with an
MFC app constantly throwing out 422 data) overwhelms my app and,
despite the fact that every one of my worker threads ends its while
loop with a sleep of equal duration (on the theory that sleep both
delays its return and yields to the next thread in line), another
thread which processes the incoming data and converts it to UDP
messages still gets hung up. For example, if the test box has a sleep
of 1ms, it slams my box with data so much that my 422-to-UDP thread
gets backlogged to the tune of several thousand messages.
When I adjust the test app's sleep to a 500ms delay, things are
considerably more calmed down and the 422-to-UDP thread is able to
keep up with the incoming data.
So my questions are,
1. Is there a way to mitigate this problem if on a real 422 box I'm
not able to adjust the data rate coming out?
2. Does sleep() actually wait the duration (I believe it does) AND
yield to other threads?
3. Is there a way to adjust thread priorities if need be if, in the
real system, I find that no matter what I do, having equal thread
priorities give me problems?
I should clarify by saying that our particular RS-422 interface
operates at a rate of 38.4 kHz but I have no idea the real rate that
test messages are being produced by the test box to send, i.e. I
assume it's on the order of 2 Hz with a 500ms delay and 1 kHz with a
1ms delay.
Thanks,
Mike
== 2 of 3 ==
Date: Wed, Oct 29 2008 10:25 am
From: Eric Sosman
Zerex71 wrote:
> Hi group,
>
> I am writing a m/t application at work that basically deals with
> several software-hardware interfaces. As one example, when the box
> (Linux RHEL 5.1 in a ruggedized form factor) reads data from an RS-422
> (serial) port from another box, it then converts the data into UDP
> datagrams to be sent on to yet a third device. In my app, I have a
> listener thread which pulls from the RS-422 card and interprets the
> raw data coming in.
>
> Now what I have discovered is in a test box which is driving my
> RS-422, if I don't throttle the messaging, the test box (a PC with an
> MFC app constantly throwing out 422 data) overwhelms my app and,
> despite the fact that every one of my worker threads ends its while
> loop with a sleep of equal duration (on the theory that sleep both
> delays its return and yields to the next thread in line), another
> thread which processes the incoming data and converts it to UDP
> messages still gets hung up. For example, if the test box has a sleep
> of 1ms, it slams my box with data so much that my 422-to-UDP thread
> gets backlogged to the tune of several thousand messages.
These "worker threads" you mention: Are they part of the
message-generating program or the message-transforming program?
That is, which box do they run on? (This may turn out to be
unimportant, but I'm trying to get a mental picture of your setup
and the focus is pretty blurry ...)
> When I adjust the test app's sleep to a 500ms delay, things are
> considerably more calmed down and the 422-to-UDP thread is able to
> keep up with the incoming data.
>
> So my questions are,
> 1. Is there a way to mitigate this problem if on a real 422 box I'm
> not able to adjust the data rate coming out?
Insufficient information.
> 2. Does sleep() actually wait the duration (I believe it does) AND
> yield to other threads?
The sleep() function I know of takes an interval specified in
seconds, so I don't understand how you're getting these shorter
durations. Also, the sleep() function I know of may wake up either
earlier or later than requested, for a number of reasons described
on the man page.
It is conceivable that a sleep() of very short duration would
be a no-op, or that a sleep() of an interval too short for the
system clock's resolution might be implemented as a busy loop (so
the thread wouldn't really sleep, just waste some time).
If a thread is not running, other threads certainly have the
opportunity to run. Whether they actually do or not is something
for them to discuss with the scheduler.
> 3. Is there a way to adjust thread priorities if need be if, in the
> real system, I find that no matter what I do, having equal thread
> priorities give me problems?
Again, where are these threads? If they're all doing pretty
much the same thing, juggling priorities is unlikely to make much
difference. General rule of thumb, applicable to most parallel
programs: Juggling priorities may alter performance, but seldom
fixes a bug.
> I should clarify by saying that our particular RS-422 interface
> operates at a rate of 38.4 kHz but I have no idea the real rate that
> test messages are being produced by the test box to send, i.e. I
> assume it's on the order of 2 Hz with a 500ms delay and 1 kHz with a
> 1ms delay.
You'd better find a way to measure it. If you don't, you're
wearing a blindfold.
== 3 of 3 ==
Date: Wed, Oct 29 2008 4:48 pm
From: David Schwartz
On Oct 29, 9:41 am, Zerex71 <mfeher1...@gmail.com> wrote:
> Now what I have discovered is in a test box which is driving my
> RS-422, if I don't throttle the messaging, the test box (a PC with an
> MFC app constantly throwing out 422 data) overwhelms my app and,
> despite the fact that every one of my worker threads ends its while
> loop with a sleep of equal duration (on the theory that sleep both
> delays its return and yields to the next thread in line), another
> thread which processes the incoming data and converts it to UDP
> messages still gets hung up. For example, if the test box has a sleep
> of 1ms, it slams my box with data so much that my 422-to-UDP thread
> gets backlogged to the tune of several thousand messages.
I'm not sure exactly what your issue is, but the sleep's are the wrong
solution to it. When the 422-to-UDP thread gets backlogged, is the CPU
maxed out?
If the CPU is maxed out, the problem is either that you just don't
have enough CPU to keep up, or that you aren't doing the most
important work. You need to rig things so that if there are too many
backlogged messages, the threads that do less important work are not
ready-to-run. A barrier of some kind that can be raised when work
backs up and lowered when you catch up may be the right solution.
If the CPU is not maxed out, then the problem probably has nothing to
do with what other threads are doing and is simply because the 422-to-
UDP thread can't make forward progress for some reason. You need to
figure out why the 422-to-UDP thread is not ready to run. Is it
blocked on something?
Tweaking the sleep is like hitting an engine harder or software with a
hammer. The 'sleep' is the wrong tool for the job, and you haven't
figured out what's wrong.
DS
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.programming.threads"
group.
To post to this group, visit http://groups.google.com/group/comp.programming.threads?hl=en
To unsubscribe from this group, send email to comp.programming.threads+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.programming.threads/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
No comments:
Post a Comment