Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #681
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Ian Collins <ian-news@hotmail.com> |
| Newsgroups | comp.programming.threads |
| Subject | Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? |
| Date | Mon, 21 Nov 2011 21:01:37 +1300 |
| Lines | 25 |
| Message-ID | <9iuer1F7g0U2@mid.individual.net> (permalink) |
| References | <4EC9C581.405E@2ndquadrant.com> <9iub8jF7g0U1@mid.individual.net> <x6zkfp52nx.fsf@2ndquadrant.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net jTGDNWLb+9QoeVktofIq3g97DN2ueVwWPG9vmjVyWY+CMVeicg |
| Cancel-Lock | sha1:vAFrbTqs3XPtfR3eqW69SQNu0Zo= |
| User-Agent | Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2 |
| In-Reply-To | <x6zkfp52nx.fsf@2ndquadrant.com> |
| Xref | x330-a1.tempe.blueboxinc.net comp.programming.threads:681 |
Show key headers only | View raw
On 11/21/11 08:56 PM, Johann 'Myrkraverk' Oskarsson wrote: > Ian Collins<ian-news@hotmail.com> writes: > > Thank you. > >> On 11/21/11 04:29 PM, Johann 'Myrkraverk' Oskarsson wrote: >>> Or, to be a little bit more explicit, is there anything I can use >>> for safe argument passing to newly created threads without >>> allocating new memory and (presumably) have the threads free it? >> >> I can't see any problem with >> >> static int something_on_my_stack = 42; > > Unfortunately, the numbers are retrieved in a loop. To be extra ex- > plicit, file descriptors from accept(), pipe() and friends. I can't > see any way that does not involve either 1) memory allocation/freeing > or 2) synchronization. Both seem unnecessary code bloat for such a > simple task. Dynamic allocation is the idiomatic solution for any non-trivial situation. Sometimes extra complexity is unavoidable. -- Ian Collins
Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com> - 2011-11-21 03:29 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Ian Collins <ian-news@hotmail.com> - 2011-11-21 20:00 +1300
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Marcel Müller <news.5.maazl@spamgourmet.com> - 2011-11-21 08:48 +0100
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com> - 2011-11-21 07:56 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Ian Collins <ian-news@hotmail.com> - 2011-11-21 21:01 +1300
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? David Schwartz <davids@webmaster.com> - 2011-11-21 12:06 -0800
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com> - 2011-11-21 20:30 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Casper H.S. Dik <Casper.Dik@OrSPaMcle.COM> - 2011-11-21 23:07 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Johann 'Myrkraverk' Oskarsson <johann@2ndquadrant.com> - 2011-11-22 05:31 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? blmblm@myrealbox.com <blmblm.myrealbox@gmail.com> - 2011-11-25 17:49 +0000
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? David Schwartz <davids@webmaster.com> - 2011-11-23 12:53 -0800
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? Robert Wessel <robertwessel2@yahoo.com> - 2011-11-21 02:28 -0600
Re: Is pthread_create( id, 0, f, &something_on_my_stack ); safe? "Ersek, Laszlo" <lacos@caesar.elte.hu> - 2011-11-22 21:06 +0100
csiph-web