Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
A book for learning threads?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  18 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Robert Miles  
View profile  
 More options Oct 28 2012, 8:26 pm
Newsgroups: comp.programming.threads
From: Robert Miles <mile...@Usenet-News.net>
Date: Sun, 28 Oct 2012 19:26:29 -0500
Local: Sun, Oct 28 2012 8:26 pm
Subject: A book for learning threads?
I'm updating a program using threads so that it can use checkpoints instead
of often running for a month or more without the ability to restart anywhere
except at the beginning.

It will later be recompiled for multiple platforms, but for now I am
only using
the Cygwin version of gcc under 64-bit Windows.  Without checkpoints, it
will
already compile for all the intended platforms, using other versions of gcc.

It uses the Posix threads method of getting threads (pthreads). However,
I've
never used threads before.  Also, I've never used Linux, and have done
little
under Unix.

I've already found that my K&R 2 book does not mention pthreads in the
index.

What book would you recommend for learning enough about threads and
pthreads that I can do a reasonable job with this update?  I'd also
consider an
online class, but not an on-campus class.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lucas Levrel  
View profile  
 More options Oct 29 2012, 4:45 am
Newsgroups: comp.programming.threads
From: Lucas Levrel <lucas.lev...@u-pec.fr>
Date: Mon, 29 Oct 2012 09:45:14 +0100
Local: Mon, Oct 29 2012 4:45 am
Subject: Re: A book for learning threads?
Le 28 octobre 2012, Robert Miles a écrit :

> What book would you recommend for learning enough about threads and
> pthreads that I can do a reasonable job with this update?  I'd also
> consider an online class, but not an on-campus class.

You should specify what kind of app you're programming. There are plenty
of books, many are specialized.

--
LL


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark  
View profile  
 More options Oct 29 2012, 5:46 am
Newsgroups: comp.programming.threads
From: Mark <i...@dontgetlotsofspamanymore.invalid>
Date: Mon, 29 Oct 2012 09:45:39 +0000
Local: Mon, Oct 29 2012 5:45 am
Subject: Re: A book for learning threads?
On Mon, 29 Oct 2012 09:45:14 +0100, Lucas Levrel

<lucas.lev...@u-pec.fr> wrote:
>Le 28 octobre 2012, Robert Miles a écrit :

>> What book would you recommend for learning enough about threads and
>> pthreads that I can do a reasonable job with this update?  I'd also
>> consider an online class, but not an on-campus class.

>You should specify what kind of app you're programming. There are plenty
>of books, many are specialized.

I'd consider looking at "Advanced Programming in the UNIX Environment
(2nd Edition)".
<http://www.amazon.com/Advanced-Programming-UNIX-Environment-Edition/d...>
I only have the first edition which does not include threading but the
second edition has.
--
(\__/)  M.
(='.'=) If a man stands in a forest and no woman is around
(")_(") is he still wrong?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rui Maciel  
View profile  
 More options Oct 29 2012, 8:52 am
Newsgroups: comp.programming.threads
From: Rui Maciel <rui.mac...@gmail.com>
Date: Mon, 29 Oct 2012 12:52:54 +0000
Local: Mon, Oct 29 2012 8:52 am
Subject: Re: A book for learning threads?

Yes.  As far as I know, the last edition of K&R dates back to 1988, and the
POSIX threads standard was only published in 1995.

> What book would you recommend for learning enough about threads and
> pthreads that I can do a reasonable job with this update?

I doubt it is the best book written on the subject, but I found O'Reilly's
pthreads programming book a good read to get up to speed on pthreads.

Hope this helps,
Rui Maciel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Miles  
View profile  
 More options Oct 29 2012, 10:42 am
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Mon, 29 Oct 2012 07:42:18 -0700 (PDT)
Local: Mon, Oct 29 2012 10:42 am
Subject: Re: A book for learning threads?

On Monday, October 29, 2012 3:45:15 AM UTC-5, Lucas Levrel wrote:
> Le 28 octobre 2012, Robert Miles a écrit :

> > What book would you recommend for learning enough about threads and
> > pthreads that I can do a reasonable job with this update?  I'd also
> > consider an online class, but not an on-campus class.

> You should specify what kind of app you're programming. There are plenty
> of books, many are specialized.

I'm updating an existing program rather than writing a new program.

It's related to RNA research and runs under BOINC.  It needs to be able to
run on multiple types of platforms, including some with Windows and some with Linux.

It uses the easel and hmmer libraries as part of the source code.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Miles  
View profile  
 More options Oct 29 2012, 10:45 am
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Mon, 29 Oct 2012 07:45:34 -0700 (PDT)
Local: Mon, Oct 29 2012 10:45 am
Subject: Re: A book for learning threads?

On Monday, October 29, 2012 7:52:55 AM UTC-5, Rui Maciel wrote:
> Robert Miles wrote:
[snip]
> > What book would you recommend for learning enough about threads and
> > pthreads that I can do a reasonable job with this update?

> I doubt it is the best book written on the subject, but I found O'Reilly's
> pthreads programming book a good read to get up to speed on pthreads.

> Hope this helps,

> Rui Maciel

Thank you.

Robert Miles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lucas Levrel  
View profile  
 More options Oct 29 2012, 12:35 pm
Newsgroups: comp.programming.threads
From: Lucas Levrel <lucas.lev...@u-pec.fr>
Date: Mon, 29 Oct 2012 17:35:13 +0100
Local: Mon, Oct 29 2012 12:35 pm
Subject: Re: A book for learning threads?
Le 29 octobre 2012, Robert Miles a crit :

> On Monday, October 29, 2012 3:45:15 AM UTC-5, Lucas Levrel wrote:
>> Le 28 octobre 2012, Robert Miles a crit :

>>> What book would you recommend for learning enough about threads and
>>> pthreads that I can do a reasonable job with this update?  I'd also
>>> consider an online class, but not an on-campus class.

>> You should specify what kind of app you're programming. There are plenty
>> of books, many are specialized.

> I'm updating an existing program rather than writing a new program.

> It's related to RNA research and runs under BOINC.

Then, be aware that many books are more IT-oriented than science-oriented
(in my opinion). If you need a primer on parallel programming, there are:
- The Art of Concurrency: introduces a classification of parallel
algorithms, which may help you identifying what threads are used for;
- An Introduction to Parallel Programming: also deals with other forms of
parallelism (MPI), but is science-oriented.

> It needs to be able to run on multiple types of platforms, including
> some with Windows and some with Linux.

If it already uses Pthreads and compiles on these platforms, where's the
worry? Just stick with the Pthread implementation of the threads concept.

--
LL


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Miles  
View profile  
 More options Oct 30 2012, 2:49 am
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Mon, 29 Oct 2012 23:49:37 -0700 (PDT)
Local: Tues, Oct 30 2012 2:49 am
Subject: Re: A book for learning threads?

There's no desire to have it run only on platforms that can run for a month or more without any interruptions.  Adding checkpoints so that it can resume with less computer time lost due to any interruptions REQUIRES understanding threads so that I can suspend all threads except the main thread when writing checkpoints or restoring from them.  I don't yet know if it also requires telling all the other threads to place information specific to those threads where the main thread can find it and include it in the checkpoint.

BOINC projects generally have budgets low enough that they need to ask volunteers for computer time on some of the computers less reliable at running for a month or more without any interruption, such as computers running Windows and without any UPS to help them through power flickers.  Therefore, it is a very useful feature to have checkpoints that can frequently save the work in progress to a checkpoint, and resume from that checkpoint later if there is some interruption such as a power outage for a few seconds longer than the computer can run without power.

I don't expect any changes to be needed for the main purpose of the program, only the very many places I need to change for adding a checkpoint feature.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lucas Levrel  
View profile  
 More options Oct 30 2012, 5:43 am
Newsgroups: comp.programming.threads
From: Lucas Levrel <lucas.lev...@u-pec.fr>
Date: Tue, 30 Oct 2012 10:43:39 +0100
Local: Tues, Oct 30 2012 5:43 am
Subject: Re: A book for learning threads?
Le 29 octobre 2012, Robert Miles a écrit :

> On Monday, October 29, 2012 11:35:14 AM UTC-5, Lucas Levrel wrote:
>> Le 29 octobre 2012, Robert Miles a écrit :

>>> It needs to be able to run on multiple types of platforms, including
>>> some with Windows and some with Linux.

>> If it already uses Pthreads and compiles on these platforms, where's the
>> worry? Just stick with the Pthread implementation of the threads concept.

> There's no desire to have it run only on platforms that can run for a
> month or more without any interruptions.  Adding checkpoints so that it
> can resume with less computer time lost due to any interruptions
> REQUIRES understanding threads so that I can suspend all threads except
> the main thread when writing checkpoints or restoring from them.

Of course. I was responding to "it needs to be able to run on multiple
types of platforms". Isn't it already?

--
LL


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Miles  
View profile  
 More options Oct 30 2012, 10:27 am
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Tue, 30 Oct 2012 07:27:27 -0700 (PDT)
Local: Tues, Oct 30 2012 10:27 am
Subject: Re: A book for learning threads?

It is.  Just not with a set of features good for persuading more volunteers to run it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Use of checkpoints for parallel data processing?" by Markus Elfring
Markus Elfring  
View profile  
 More options Nov 1 2012, 8:31 am
Newsgroups: comp.programming.threads
From: Markus Elfring <Markus.Elfr...@web.de>
Date: Thu, 01 Nov 2012 13:31:57 +0100
Local: Thurs, Nov 1 2012 8:31 am
Subject: Re: Use of checkpoints for parallel data processing?

> I don't expect any changes to be needed for the main purpose of the program, only the very many places I need to change for adding a checkpoint feature.

Can you reuse any software library for the needed functionality "checkpointing"?

Regards,
Markus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A book for learning threads?" by Rui Maciel
Rui Maciel  
View profile  
 More options Nov 1 2012, 1:55 pm
Newsgroups: comp.programming.threads
From: Rui Maciel <rui.mac...@gmail.com>
Date: Thu, 01 Nov 2012 17:55:28 +0000
Local: Thurs, Nov 1 2012 1:55 pm
Subject: Re: A book for learning threads?

Robert Miles wrote:
> There's no desire to have it run only on platforms that can run for a
> month or more without any interruptions.  Adding checkpoints so that it
> can resume with less computer time lost due to any interruptions REQUIRES
> understanding threads so that I can suspend all threads except the main
> thread when writing checkpoints or restoring from them.  I don't yet know
> if it also requires telling all the other threads to place information
> specific to those threads where the main thread can find it and include it
> in the checkpoint.

The pthreads standard defines essentially a set of primitive operations,
which are then put together to pull off whatever concurency tricks you wish
to pull.  This means that implementing the "checkpoint" feature you referred
to isn't necessarily a pthreads issue; only a software design one.  

You didn't said what you mean by "checkpoint".  Without any specific
details, it might be possible that it only take a single mutex to be able to
implement your "checkpoints" feature.  Nevertheless, this only depends on
what your requirements are, and how you designed/will design your software.  
Pthreads is orthogonal to this.

Hope this helps,
Rui Maciel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Use of checkpoints for parallel data processing?" by Robert Miles
Robert Miles  
View profile  
 More options Nov 1 2012, 9:39 pm
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Thu, 1 Nov 2012 18:39:30 -0700 (PDT)
Local: Thurs, Nov 1 2012 9:39 pm
Subject: Re: Use of checkpoints for parallel data processing?

On Thursday, November 1, 2012 7:31:58 AM UTC-5, Markus Elfring wrote:
> > I don't expect any changes to be needed for the main purpose of the program, only the very many places I need to change for adding a checkpoint feature.

> Can you reuse any software library for the needed functionality "checkpointing"?

> Regards,

> Markus

I doubt it.  Checkpointing is writing the current state of the program to a disk file, so that the program can restart from that state later if some interruption makes it necessary.  Deciding what to write is very program-dependent; I do not expect any software library to do a decent job at deciding this.

It is REQUIRED that no other threads are still changing the state of the program while this is done.

At least under Windows, the memory will probably be rearranged when the program restarts, so just writing everything back to the same addresses in memory will not work - some of its previous memory is now likely to already be in use by some other program.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A book for learning threads?" by Ian Collins
Ian Collins  
View profile  
 More options Nov 2 2012, 9:52 pm
Newsgroups: comp.programming.threads
From: Ian Collins <ian-n...@hotmail.com>
Date: Sat, 03 Nov 2012 14:52:53 +1300
Local: Fri, Nov 2 2012 9:52 pm
Subject: Re: A book for learning threads?
On 10/30/12 19:49, Robert Miles wrote:

> On Monday, October 29, 2012 11:35:14 AM UTC-5, Lucas Levrel wrote:

>> If it already uses Pthreads and compiles on these platforms, where's the
>> worry? Just stick with the Pthread implementation of the threads concept.

Please trim your lines and tidy up the mess google makes of your replies!

> There's no desire to have it run only on platforms that can run for a month or more without any interruptions.  Adding checkpoints so that it can resume with less computer time lost due to any interruptions REQUIRES understanding threads so that I can suspend all threads except the main thread when writing checkpoints or restoring from them.  I don't yet know if it also requires telling all the other threads to place information specific to those threads where the main thread can find it and include it in the checkpoint..

Applications like BOINC typically dish out units of work to client
machines and these in turn pass them on to worker threads.  In this
case, it makes sense for the unit of work to be scaled to be a) useful
and b) small enough so not too much is wasted if the machine dies during
processing.

Saving state part way through a work unit probably isn't worth while.
Make your "checkpoints" the completion of a work unit.

--
Ian Collins


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Miles  
View profile  
 More options Nov 3 2012, 2:46 am
Newsgroups: comp.programming.threads
From: Robert Miles <robertmiles...@gmail.com>
Date: Fri, 2 Nov 2012 23:46:06 -0700 (PDT)
Local: Sat, Nov 3 2012 2:46 am
Subject: Re: A book for learning threads?

On Friday, November 2, 2012 8:52:55 PM UTC-5, Ian Collins wrote:
> On 10/30/12 19:49, Robert Miles wrote:

> > On Monday, October 29, 2012 11:35:14 AM UTC-5, Lucas Levrel wrote:

> >> If it already uses Pthreads and compiles on these platforms, where's the
> >> worry? Just stick with the Pthread implementation of the threads concept.

> Please trim your lines and tidy up the mess google makes of your replies!

Trying.

There's no good division of the process to allow the many of the workunits to
be less than a month long, and sometimes longer.  If there was, checkpoints
would already be available.

There's also a much smaller type of workunits for the much shorter RNAs; these
already have checkpoints at the end of each section of RNA.  However, this doesn't work for the larger RNAs, such as most of those found in humans and
other mammals.  The nature of the problem just doesn't allow doing much with
arbitrarily chopped pieces of the RNA.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Use of checkpoints for parallel data processing?" by Markus Elfring
Markus Elfring  
View profile  
 More options Nov 5 2012, 1:58 pm
Newsgroups: comp.programming.threads
From: Markus Elfring <Markus.Elfr...@web.de>
Date: Mon, 05 Nov 2012 19:58:21 +0100
Local: Mon, Nov 5 2012 1:58 pm
Subject: Re: Use of checkpoints for parallel data processing?

> Deciding what to write is very program-dependent;

I agree ...

> I do not expect any software library to do a decent job at deciding this.

How do you think about information from documents like the following?
http://en.wikipedia.org/wiki/Application_checkpointing#Practical_impl...
http://boinc.berkeley.edu/trac/wiki/BasicApi#checkpointing

Regards,
Markus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus Elfring  
View profile  
 More options Nov 5 2012, 2:00 pm
Newsgroups: comp.programming.threads
From: Markus Elfring <Markus.Elfr...@web.de>
Date: Mon, 05 Nov 2012 20:00:09 +0100
Local: Mon, Nov 5 2012 2:00 pm
Subject: Re: Use of checkpoints for parallel data processing?

> Deciding what to write is very program-dependent;

I agree ...

> I do not expect any software library to do a decent job at deciding this.

How do you think about information from documents like the following?
http://en.wikipedia.org/wiki/Application_checkpointing#Practical_impl...
http://boinc.berkeley.edu/trac/wiki/BasicApi#checkpointing

Regards,
Markus


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "A book for learning threads?" by Ian Collins
Ian Collins  
View profile  
 More options Nov 6 2012, 4:37 pm
Newsgroups: comp.programming.threads
From: Ian Collins <ian-n...@hotmail.com>
Date: Wed, 07 Nov 2012 10:37:48 +1300
Local: Tues, Nov 6 2012 4:37 pm
Subject: Re: A book for learning threads?
On 11/03/12 19:46, Robert Miles wrote:

I still see this as a problem for the work unit rather than a threading
one.  Surly it would be easier for the work unit to know when would be a
good time to dump its state rather than rely on an application wide
mechanism?  If the computations use multiple threads, each thread could
save its own state.

--
Ian Collins


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »