comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Threads in IDL 7.0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Threads in IDL 7.0 [message #63120] Mon, 27 October 2008 05:55 Go to next message
Bernhard Reinhardt is currently offline  Bernhard Reinhardt
Messages: 26
Registered: October 2008
Junior Member
Hi,

I have have read the Chapter "Multithreading in IDL" in the IDL-Help. As
far as I can see some IDL functions use threads.

Basically I want to count elements of a big array that exceed a given
number.

count=0
for i = 0, 200000 do begin
if array[i] ge 10. then count++
endfor

On my dual-core computer top shows a CPU-load of about 50%. So I guess
IDL handles this problem single-threaded.

Is there a simple way to split the task. Something like

;Thread 1
count1=0
for i = 0, 100000 do begin
if array[i] ge 10. then count1++
endfor

;Thread 2
count2=0
for i = 100001, 200000 do begin
if array[i] ge 10. then count2++
endfor

count = count1 + count2

Regards

Bernhard
Re: Threads in IDL 7.0 [message #63304 is a reply to message #63120] Mon, 03 November 2008 15:12 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Hi,

nobody mentioned the IDL to IDL bridge... have one session to work on
data 0 to i, and the main session works on data i+1 to n....

it's relatively simple, though I have experienced very unpleasant
results when stopping the program by control+C...

Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Moving to objects loses array functionality?
Next Topic: Re: Multiple click region growing

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:15:14 PDT 2025

Total time taken to generate the page: 0.80490 seconds