Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Issue 11543028: Allow creating a NaClAppThread without creating a new host OS thread (Closed)

Created:
8 years ago by Mark Seaborn
Modified:
8 years ago
Reviewers:
bsy
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Allow creating a NaClAppThread without creating a new host OS thread Split the thread-launching part of NaClAppThreadMake() into a separate function, NaClAppThreadSpawn(). This is intended so that an embedder of NaCl can run untrusted code without the overhead of creating a new host OS thread. I have added an example of this to tests/minnacl. * This means that an embedder might leave NaClAppThread's "thread" field uninitialized. I have added a "host_thread_is_defined" field so that the thread suspension code doesn't use an undefined "thread" value accidentally in this case, and so that NaClAppThread is freed correctly if NaClThreadCtor() fails. * Rename NaClAppThread's "thread" to "host_thread" for greppability. * Rename NaClThreadLauncher() to NaClAppThreadLauncher() for consistency. * Split out NaClGetInitialStackTop() from NaClCreateMainThread() to avoid duplicating its logic in the test. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3223 TEST=run_minnacl_test Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=10475

Patch Set 1 #

Patch Set 2 : Fix unit test #

Patch Set 3 : Fix pointer conversion #

Patch Set 4 : Add comments #

Total comments: 6

Patch Set 5 : Remove dead statement #

Total comments: 2

Patch Set 6 : Review: Add NACL_WUR #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -77 lines) Patch
M src/trusted/service_runtime/linux/thread_suspension.c View 1 chunk +2 lines, -1 line 0 comments Download
M src/trusted/service_runtime/nacl_app_thread.h View 1 2 3 4 5 3 chunks +30 lines, -7 lines 0 comments Download
M src/trusted/service_runtime/nacl_app_thread.c View 1 2 3 4 6 chunks +41 lines, -13 lines 0 comments Download
M src/trusted/service_runtime/osx/thread_suspension.c View 7 chunks +9 lines, -8 lines 0 comments Download
M src/trusted/service_runtime/sel_ldr.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/trusted/service_runtime/sel_ldr_standard.c View 5 chunks +31 lines, -30 lines 0 comments Download
M src/trusted/service_runtime/thread_suspension_test.cc View 1 2 chunks +7 lines, -4 lines 0 comments Download
M src/trusted/service_runtime/win/thread_suspension.c View 6 chunks +11 lines, -5 lines 0 comments Download
M tests/minnacl/minimal_test_host.c View 1 2 4 chunks +33 lines, -8 lines 0 comments Download
M tests/minnacl/nacl.scons View 1 chunk +11 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Mark Seaborn
8 years ago (2012-12-13 18:00:54 UTC) #1
bsy
https://codereview.chromium.org/11543028/diff/15001/src/trusted/service_runtime/linux/thread_suspension.c File src/trusted/service_runtime/linux/thread_suspension.c (right): https://codereview.chromium.org/11543028/diff/15001/src/trusted/service_runtime/linux/thread_suspension.c#newcode254 src/trusted/service_runtime/linux/thread_suspension.c:254: CHECK(natp->host_thread_is_defined); if we are trying to make it so ...
8 years ago (2012-12-17 21:02:05 UTC) #2
Mark Seaborn
https://codereview.chromium.org/11543028/diff/15001/src/trusted/service_runtime/linux/thread_suspension.c File src/trusted/service_runtime/linux/thread_suspension.c (right): https://codereview.chromium.org/11543028/diff/15001/src/trusted/service_runtime/linux/thread_suspension.c#newcode254 src/trusted/service_runtime/linux/thread_suspension.c:254: CHECK(natp->host_thread_is_defined); On 2012/12/17 21:02:05, bsy wrote: > if we ...
8 years ago (2012-12-17 22:30:14 UTC) #3
Mark Seaborn
I have filed this issue to give more context on the design: https://code.google.com/p/nativeclient/issues/detail?id=3223 Please take ...
8 years ago (2012-12-18 23:49:30 UTC) #4
bsy
one nit. o/w lgtm. https://codereview.chromium.org/11543028/diff/19001/src/trusted/service_runtime/nacl_app_thread.h File src/trusted/service_runtime/nacl_app_thread.h (right): https://codereview.chromium.org/11543028/diff/19001/src/trusted/service_runtime/nacl_app_thread.h#newcode181 src/trusted/service_runtime/nacl_app_thread.h:181: uint32_t user_tls2); please annotate w/ ...
8 years ago (2012-12-19 00:07:09 UTC) #5
Mark Seaborn
8 years ago (2012-12-19 00:54:18 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/11543028/diff/19001/src/trusted/service_runti...
File src/trusted/service_runtime/nacl_app_thread.h (right):

https://codereview.chromium.org/11543028/diff/19001/src/trusted/service_runti...
src/trusted/service_runtime/nacl_app_thread.h:181: uint32_t       user_tls2);
On 2012/12/19 00:07:09, bsy wrote:
> please annotate w/ NACL_WUR

Done.

Powered by Google App Engine
This is Rietveld 408576698