Daniel Hilst Selli | 14 Mar 16:08 2014
Picon

passing arguments to pthreads

Hi, I have a question about passing multiple arguments to pthreads, the 
big deal is where the paremeters are kept.. I see two possible 
solutions.. keep it on static variables that are never deallocated.. or 
on heap.. so here is my first question

Passing local (stack) variables as arguments to thread is trouble, since 
the scope of this variables can go away before my thread returns..right? 
So forget about local variables

So here is the two options I see, static vs heap...
I'm using this model on one of my applications, is the same senario, a 
function that receives 3 ints as arguments and is called as a thread.. I 
create a little wrapper... here is the code http://pastebin.com/Air7u0YD

How gurus does this? I free the args on threadfd wrapper since, on my 
real application can't join the thread, to be honest, is and deatached 
thread.. Is there something wrong with this strategy, it seems ugly to 
me....

Cheers,

--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

ratheesh kannoth | 12 Mar 12:17 2014
Picon

Re: ASLR and -fpic

so if i enable  ASLR  using   /proc/sys/kernel/randomize_va_space,
already compiled programs ( with out fpic  ) will not be randomised ?

On Wed, Mar 12, 2014 at 4:24 PM, Raphael S Carvalho
<raphael.scarv <at> gmail.com> wrote:
>
>
>
> On Wed, Mar 12, 2014 at 7:47 AM, ratheesh kannoth <ratheesh.ksz <at> gmail.com>
> wrote:
>>
>> If we need ASLR  feature, should we compile executable with -fpic ?
>
> -fPIE -fstack-protector-all
>
>>
>>
>>
>>
>>
>>
>> -Ratheesh
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-c-programming" in
>> the body of a message to majordomo <at> vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
(Continue reading)

ratheesh kannoth | 12 Mar 11:47 2014
Picon

ASLR and -fpic

If we need ASLR  feature, should we compile executable with -fpic ?

-Ratheesh
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Qu Wenruo | 5 Feb 02:23 2014

About the memory ordering and function call

Hi,

Notsure it's suitable to ask here,but a strange memory order related
problem happens.
Related codes are like below (somewhat simplified)

------
struct my_work {
/* someunrelated variants */
struct SOME_OTHER_STRUCT *my_pointer; <<< Attention here
struct work_struct normal_work;
};

void my_queue_work(struct workqueue_struct *wq, <<< wq is WQ_UNBOUND
workqueue
struct my_work *work)
{
/*
* the work->normal_work is initialized somewhere else,
* and the work job will use the work->my_pointer.
*/

work->my_pointer = something; <<< The problem
/* Do something else */
queue_work(wq, work->normal_work);
}
------

The codes runs fine on all my *INTEL* boxes but kernel panic on *AMD*
boxes(othertesters', so I can't reproduce it),
(Continue reading)

Daniel Hilst Selli | 27 Jan 14:24 2014
Picon

make rule heritage, is that possible?

I was writing a set of makefiles to build some of my projects and I see 
me copying/pasting some rules that are exactly the same, only changing 
the directory where they are executed and the variables contents.

Is there a way to write this kind of rules once and let it been 
inherited from a make directory level to another...

I think on something like this,

Top Makefile
--
generic-rule:
	...
--

subdir/Makefile
--
inherit generic-rule
--

I think about writing this rules on a Common.mk makefile and -include 
this file. Does anyone tried someting like that before?
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

The Weir Foundation | 22 Aug 04:08 2013
Picon

Dear Beneficiary

Dear Beneficiary

My Wife Christine and I are donating £550,000 to you.Contact us via my wife email at
(funds.christineweir.fundation <at> gmail.com) for further details.

Best Regards, 
Colin & Christine Weir• 
Copyright ©2013• The Weir Foundation• All Rights Reserved•
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

The Weir Foundation | 22 Aug 10:11 2013
Picon

Dear Beneficiary

Dear Beneficiary

My Wife Christine and I are donating £550,000 to you.Contact 

us via my wife email at

(funds.christineweir.fundation <at> gmail.com) for further 

details.

Best Regards, 
Colin & Christine Weir• 
Copyright ©2013• The Weir Foundation• All Rights Reserved•
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

The Weir Foundation | 22 Aug 08:20 2013
Picon

Dear Beneficiary

Dear Beneficiary

My Wife Christine and I are donating £550,000 to you.Contact us via my wife email
at:(funds.christineweir.fundation <at> gmail.com) for further details.

Best Regards, 
Colin & Christine Weir• 
Copyright ©2013• The Weir Foundation• All Rights Reserved•
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Romain Geissler | 15 Apr 09:48 2013
Picon

mq_timedreceive on multiple queues

Hi,

I am currently facing an issue when reading in a set of several posix
queues (let's say 2 different mqueues) from several processes. I
currently use epoll_wait to wait for an incoming message on either
queue on all listening processes, then mq_timedreceive to retrieve it
from the queue.

This is an issue when the number of reader process grows, as if I send
only one message on a queue, all processes are awaken when epoll_wait
returns, and all processes try to fetch the message. I would like to
fix this and wake up only one process when listening to several
queues, removing the useless user/kernel space switchs for the other
listening processes.

Is there any way to run a mq_receive/mq_timedreceive on several
queues, that would wake up only one process? Something more or less
like epoll, but that also fetches a message from the readable queues
before returning.

Thanks,
Romain
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Randi Botse | 23 Mar 03:52 2013
Picon

Sending and receiving packets from multiple lines

Hi All,

My network implements interface bonding, aggregate several lines into
one logical line to achieve higher connection throughput and
redundancy.
I'm writing a network application in Linux that basically send packets
to another host outside. I got problem with packet ordering on
destination host, for example. packet1 from line1 should arrived
earlier than packet3 from line3, etc. I want them to be delivered in
correct order. Is this possible? if yes, what is the better way for
doing this?.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

SL@maxis | 11 Dec 08:06 2012

post try

Please ignore. Sorry

--

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane