Re: locking file on smp based kernel with multi-threadng

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/03/07, Deepak Joshi <deepak_cins@xxxxxxxxxxx> wrote:
 Will there be a situation where two threads running on two different
processors tries to write to the same logging file ?

If your application has two threads that both write to the same file,
then you have to serialize that access yourself if you don't want
output from the two threads mixed up.

In that case how do i
achive synchronization or it will be taken care by smp kernel itself ?

The kernel won't do it for you.  You can use a mutex, you can use
flock() or more or less any other synchronization method you can think
of.

--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux