Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
writing to disk in background

Subject: writing to disk in background

From: Patrick

Date: 12 Jun, 2012 00:33:07

Message: 1 of 4

Is there any way to write the disk in the background? I have a long job and it would be great if we could process the next data set while writing the last set disk. Having fwrite() return almost immediately would be the simplest fix, but I don't think thats possible. Would it be necessary to write a MEX function that spawned a seperate thread to handing the writing?

Subject: writing to disk in background

From: dpb

Date: 12 Jun, 2012 01:17:05

Message: 2 of 4

On 6/11/2012 7:33 PM, Patrick wrote:
> Is there any way to write the disk in the background? I have a long job
> and it would be great if we could process the next data set while
> writing the last set disk. Having fwrite() return almost immediately
> would be the simplest fix, but I don't think thats possible. Would it be
> necessary to write a MEX function that spawned a seperate thread to
> handing the writing?

I doubt you'd save anything (other than in appearance, maybe) unless you
could also spawn it on a second processor as the time split between the
threads will be doing one of the two, anyway.

--

Subject: writing to disk in background

From: TideMan

Date: 12 Jun, 2012 05:39:33

Message: 3 of 4

On Tuesday, June 12, 2012 12:33:07 PM UTC+12, Patrick wrote:
> Is there any way to write the disk in the background? I have a long job and it would be great if we could process the next data set while writing the last set disk. Having fwrite() return almost immediately would be the simplest fix, but I don't think thats possible. Would it be necessary to write a MEX function that spawned a seperate thread to handing the writing?

And this is the difficulty with parallelisation.
There are not many applications (in my experience) where the saving in computation exceeds the cost in communication between processors.
One application that does qualify is Monte Carlo modelling, where you can simply divide the number of runs between processors and avoid talking to anyone else until the end.

Subject: writing to disk in background

From: Bruno Luong

Date: 12 Jun, 2012 06:46:07

Message: 4 of 4

"Patrick " <praphael@gmail.com> wrote in message <jr62o3$hsm$1@newscl01ah.mathworks.com>...
> Is there any way to write the disk in the background? I have a long job and it would be great if we could process the next data set while writing the last set disk. Having fwrite() return almost immediately would be the simplest fix, but I don't think thats possible. Would it be necessary to write a MEX function that spawned a seperate thread to handing the writing?

Have you tried the timer?

Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us